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.FileNotFoundException
public DirectoryPackageInput(java.lang.String dir) throws java.io.FileNotFoundException
java.io.FileNotFoundException
private void initializePackageInput() throws java.io.FileNotFoundException
java.io.FileNotFoundException
private void collectEntries(java.io.File d) throws java.io.FileNotFoundException
java.io.FileNotFoundException
private java.lang.String getEntryName(java.io.File fileEntry)
public boolean gotoEntry(java.lang.String name) throws java.io.IOException
PackageInput
gotoEntry
in interface PackageInput
java.io.IOException
public boolean gotoEntry(java.lang.String path, java.lang.String name) throws java.io.IOException
PackageInput
gotoEntry
in interface PackageInput
java.io.IOException
public java.lang.String gotoNextEntry() throws java.io.IOException
PackageInput
gotoNextEntry
in interface PackageInput
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
PackageInput
getInputStream
in interface PackageInput
java.io.IOException
public void close() throws java.io.IOException
PackageInput
close
in interface PackageInput
java.io.IOException
public java.util.Collection<java.lang.String> getEntries() throws java.io.IOException
PackageInput
getEntries
in interface PackageInput
java.io.IOException
private void closeCurrentInputStream() throws java.io.IOException
java.io.IOException
private java.io.InputStream getCurrentInputStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public java.lang.String getSeparator()
PackageInput
getSeparator
in interface PackageInput
public java.lang.String joinPath(java.lang.String path, java.lang.String name)
PackageInput
joinPath
in interface PackageInput
Copyright 2004-2015 Wandora Team