public class DirectoryPackageInput extends java.lang.Object implements PackageInput
| Modifier and Type | Field and Description |
|---|---|
private int |
currentEntry |
private java.io.File |
directory |
private java.util.List<java.lang.String> |
entries |
private java.io.InputStream |
inputStream |
| Constructor and Description |
|---|
DirectoryPackageInput(java.io.File dir) |
DirectoryPackageInput(java.lang.String dir) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the package.
|
private void |
closeCurrentInputStream() |
private void |
collectEntries(java.io.File d) |
private java.io.InputStream |
getCurrentInputStream() |
java.util.Collection<java.lang.String> |
getEntries()
Get list of entries in the package.
|
private java.lang.String |
getEntryName(java.io.File fileEntry) |
java.io.InputStream |
getInputStream()
Gets input stream for current entry.
|
java.lang.String |
getSeparator()
Returns file separator used by the PackageInput.
|
boolean |
gotoEntry(java.lang.String name)
Moves to the entry that has the given name.
|
boolean |
gotoEntry(java.lang.String path,
java.lang.String name)
Moves to the entry that has the given path and name.
|
java.lang.String |
gotoNextEntry()
Moves to next entry and returns it's name.
|
private void |
initializePackageInput() |
java.lang.String |
joinPath(java.lang.String path,
java.lang.String name)
Joins path and name, and returns joined resource name.
|
private java.io.File directory
private java.util.List<java.lang.String> entries
private int currentEntry
private java.io.InputStream inputStream
public DirectoryPackageInput(java.io.File dir)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic DirectoryPackageInput(java.lang.String dir)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprivate void initializePackageInput()
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprivate void collectEntries(java.io.File d)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionprivate java.lang.String getEntryName(java.io.File fileEntry)
public boolean gotoEntry(java.lang.String name)
throws java.io.IOException
PackageInputgotoEntry in interface PackageInputjava.io.IOExceptionpublic boolean gotoEntry(java.lang.String path,
java.lang.String name)
throws java.io.IOException
PackageInputgotoEntry in interface PackageInputjava.io.IOExceptionpublic java.lang.String gotoNextEntry()
throws java.io.IOException
PackageInputgotoNextEntry in interface PackageInputjava.io.IOExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
PackageInputgetInputStream in interface PackageInputjava.io.IOExceptionpublic void close()
throws java.io.IOException
PackageInputclose in interface PackageInputjava.io.IOExceptionpublic java.util.Collection<java.lang.String> getEntries()
throws java.io.IOException
PackageInputgetEntries in interface PackageInputjava.io.IOExceptionprivate void closeCurrentInputStream()
throws java.io.IOException
java.io.IOExceptionprivate java.io.InputStream getCurrentInputStream()
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic java.lang.String getSeparator()
PackageInputgetSeparator in interface PackageInputpublic java.lang.String joinPath(java.lang.String path,
java.lang.String name)
PackageInputjoinPath in interface PackageInputCopyright 2004-2015 Wandora Team