com.planet_ink.coffee_web.interfaces.FileManager
public static class CMFile.CMFileManager
extends java.lang.Object
implements com.planet_ink.coffee_web.interfaces.FileManager
Constructor | Description |
---|---|
CMFileManager() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
allowedToReadData(java.io.File file) |
Returns true if the file exists and is readable and meets any other
criteria the manager desires before deciding whether to allow reading.
|
java.io.File |
createFileFromPath(java.io.File parent,
java.lang.String localPath) |
Create a file object from the given local path
|
java.io.File |
createFileFromPath(java.lang.String localPath) |
Create a file object from the given local path
|
char |
getFileSeparator() |
Return the appropriate file separator for this fs
|
java.io.InputStream |
getFileStream(java.io.File file) |
Return a readable input stream of the given files data
|
java.io.RandomAccessFile |
getRandomAccessFile(java.io.File file) |
Return a readable input stream of the given files data
|
byte[] |
readFile(java.io.File file) |
Read the data out out of the given file
|
boolean |
supportsRandomAccess(java.io.File file) |
Returns whether the given file can be randomly accessed
|
public char getFileSeparator()
com.planet_ink.coffee_web.interfaces.FileManager
getFileSeparator
in interface com.planet_ink.coffee_web.interfaces.FileManager
public java.io.File createFileFromPath(java.lang.String localPath)
com.planet_ink.coffee_web.interfaces.FileManager
createFileFromPath
in interface com.planet_ink.coffee_web.interfaces.FileManager
localPath
- the path c:\dljl\sdf\ format.public java.io.File createFileFromPath(java.io.File parent, java.lang.String localPath)
com.planet_ink.coffee_web.interfaces.FileManager
createFileFromPath
in interface com.planet_ink.coffee_web.interfaces.FileManager
parent
- the parent path c:\dljl\sdf\ format.localPath
- the path c:\dljl\sdf\ format.public byte[] readFile(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
com.planet_ink.coffee_web.interfaces.FileManager
readFile
in interface com.planet_ink.coffee_web.interfaces.FileManager
file
- the file to readjava.io.IOException
- a read errorjava.io.FileNotFoundException
- the file was not foundpublic java.io.InputStream getFileStream(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
com.planet_ink.coffee_web.interfaces.FileManager
getFileStream
in interface com.planet_ink.coffee_web.interfaces.FileManager
file
- the file to readjava.io.IOException
- a read errorjava.io.FileNotFoundException
- the file was not foundpublic java.io.RandomAccessFile getRandomAccessFile(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
com.planet_ink.coffee_web.interfaces.FileManager
getRandomAccessFile
in interface com.planet_ink.coffee_web.interfaces.FileManager
file
- the file to readjava.io.IOException
- a read errorjava.io.FileNotFoundException
- the file was not foundpublic boolean supportsRandomAccess(java.io.File file)
com.planet_ink.coffee_web.interfaces.FileManager
supportsRandomAccess
in interface com.planet_ink.coffee_web.interfaces.FileManager
file
- the filemanager file to check for random access support.public boolean allowedToReadData(java.io.File file)
com.planet_ink.coffee_web.interfaces.FileManager
allowedToReadData
in interface com.planet_ink.coffee_web.interfaces.FileManager
file
- the file from this manager to check