Package VASSAL.tools.io
Interface FileStore
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
ImageTileDiskCache
An interface for providing read access to files.
- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the store.booleanQueries whether a file exists in the store.getFiles()Gets the list of files in the store.Gets the list of files under a given directory of the store.getInputStream(String path) Gets anInputStreamto read from the given file.longGets the modification time of a file in the store, in milliseconds since the epoch.longGets the size of a file in the store, in bytes.booleanisClosed()Checks whether the store is closed.
-
Method Details
-
contains
Queries whether a file exists in the store.- Parameters:
path- the path to the file in the store- Returns:
trueif the file exists in the store- Throws:
IOException- oops
-
getInputStream
Gets anInputStreamto read from the given file.- Parameters:
path- the path to the file in the store- Returns:
- an
InputStreamcontaining the requested file - Throws:
IOException- oops
-
getSize
Gets the size of a file in the store, in bytes.- Parameters:
path- the path to the file in the store- Returns:
- the size of the file, in bytes
- Throws:
FileNotFoundException- ifpathis not in the storeIOException- oops
-
getMTime
Gets the modification time of a file in the store, in milliseconds since the epoch.- Parameters:
path- the path to the file in the store- Returns:
- the mtime of the file
- Throws:
FileNotFoundException- ifpathis not in the storeIOException- oops
-
getFiles
Gets the list of files in the store.- Returns:
- the list of files in the store
- Throws:
IOException- oops
-
getFiles
Gets the list of files under a given directory of the store.- Parameters:
root- the directory- Returns:
- the list of files under the given directory
- Throws:
FileNotFoundException- ifrootis not in the storeIOException- oops
-
close
Closes the store.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- oops
-
isClosed
boolean isClosed()Checks whether the store is closed.- Returns:
trueif the archive is closed
-