public abstract class BundleFile extends Object
Clients may extend this class.
Modifier and Type | Field and Description |
---|---|
protected File |
basefile
The File object for this BundleFile.
|
protected static String |
PROP_SETPERMS_CMD |
Constructor and Description |
---|
BundleFile()
Default constructor
|
BundleFile(File basefile)
BundleFile constructor
|
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes the BundleFile.
|
abstract boolean |
containsDir(String dir)
Determines if any BundleEntries exist in the given directory path.
|
static String |
fixTrailingSlash(String path,
BundleEntry entry) |
File |
getBaseFile()
Returns the base file for this BundleFile
|
abstract BundleEntry |
getEntry(String path)
Locates a file name in this bundle and returns a BundleEntry object
|
abstract Enumeration<String> |
getEntryPaths(String path)
Allows to access the entries of the bundle.
|
abstract File |
getFile(String path,
boolean nativeCode)
Returns a File for the bundle entry specified by the path.
|
URL |
getResourceURL(String path,
BaseData hostData,
int index)
Returns a URL to access the contents of the entry specified by the path
|
URL |
getResourceURL(String path,
long hostBundleID)
Deprecated.
|
URL |
getResourceURL(String path,
long hostBundleID,
int index)
Deprecated.
|
abstract void |
open()
Opens the BundleFiles.
|
static void |
setPermissions(File file)
Attempts to set the permissions of the file in a system dependent way.
|
String |
toString() |
protected static final String PROP_SETPERMS_CMD
protected File basefile
public BundleFile()
public BundleFile(File basefile)
basefile
- The File object where this BundleFile is
persistently stored.public abstract File getFile(String path, boolean nativeCode)
path
- The path to the entry to locate a File for.nativeCode
- true if the path is native code.public abstract BundleEntry getEntry(String path)
path
- path of the entry to locate in the bundlepublic abstract Enumeration<String> getEntryPaths(String path)
path
- path of the entry to locate in the bundlepublic abstract void close() throws IOException
IOException
- if any error occurs.public abstract void open() throws IOException
IOException
- if any error occurs.public abstract boolean containsDir(String dir)
dir
- The directory path to check existence of.public URL getResourceURL(String path, long hostBundleID)
getResourceURL(String, BaseData, int)
path
- the path to the resourcehostBundleID
- the host bundle IDpublic URL getResourceURL(String path, long hostBundleID, int index)
getResourceURL(String, BaseData, int)
path
- the path to the resourcehostBundleID
- the host bundle IDindex
- the resource indexpublic URL getResourceURL(String path, BaseData hostData, int index)
path
- the path to the resourcehostData
- the host BaseDataindex
- the resource indexpublic File getBaseFile()
public static void setPermissions(File file)
file
- the file to set the permissions onpublic static String fixTrailingSlash(String path, BundleEntry entry)
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.