public class FileManager extends Object
Modifier and Type | Method and Description |
---|---|
AlpacaFile |
get(AlpacaFileToken pathToken)
Gets the AlpacaFile given the provided path token.
|
<T extends BroadWorksObjectInformation> |
get(Type type,
AlpacaFileToken pathToken,
BroadWorksServer broadWorksServer)
Gets the BroadWorksObjectInformation at the provided path token.
|
File |
getContextDirectory(BroadWorksServer context)
Retrieves the context directory for the given BroadWorksServer
|
File |
getContextDirectory(String context)
Retrieves the context directory for the given BroadWorksServer
|
File |
getLocation(BroadWorksServer context,
String fileName)
Retrieves an available file location with the given file name.
|
File |
getLocation(File contextDirectory,
String fileName,
String extension)
Retrieves an available file location with the given file name.
|
File |
getLocation(File contextDirectory,
String fileName,
String extension,
boolean overwrite)
Retrieves an available file location with the given file name.
|
static FileManager |
getManager() |
File |
getUnorderedLocation(BroadWorksServer context)
Retrieves a randomly available location within the FileManager
|
AlpacaFileToken |
put(BroadWorksServer context,
byte[] data)
Puts the provided byte array data into a file on the file system.
|
AlpacaFileToken |
put(BroadWorksServer context,
File location,
byte[] data)
Puts the provided byte array data at the specific file location on the system.
|
AlpacaFileToken |
put(BroadWorksServer context,
File location,
Serializable object)
Puts the provided String data into a file on the file system.
|
AlpacaFileToken |
put(BroadWorksServer context,
Serializable object)
Puts the provided String data into a file on the file system.
|
AlpacaFileToken |
put(BroadWorksServer context,
String string)
Puts the provided String data into a file on the file system.
|
AlpacaFileToken |
put(BroadWorksServer context,
String fileName,
String string)
Puts the provided String data into a file with the desired file name on the file system.
|
AlpacaFileToken |
put(String context,
File location,
Serializable object)
Puts the provided String data into a file on the file system.
|
public static FileManager getManager() throws HelperException
HelperException
public File getContextDirectory(String context)
context
- The context string to retrieve the context directory.File
object for the given directory.public File getContextDirectory(BroadWorksServer context)
context
- The BroadWorksServer to retrieve the context directory.File
object for the given directory.public File getLocation(BroadWorksServer context, String fileName)
context
- The BroadWorksServer contextfileName
- The desired file namepublic File getLocation(File contextDirectory, String fileName, String extension)
contextDirectory
- The context directoryfileName
- The desired file namepublic File getLocation(File contextDirectory, String fileName, String extension, boolean overwrite)
contextDirectory
- The context directoryfileName
- The desired file nameextension
- The file extension if desiredoverwrite
- Overwrite file if already existspublic File getUnorderedLocation(BroadWorksServer context)
context
- The BroadWorksServer contextpublic AlpacaFileToken put(BroadWorksServer context, String fileName, String string) throws IOException
context
- The BroadWorksServer contextfileName
- The fileName to store.string
- The data to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(BroadWorksServer context, File location, Serializable object) throws IOException
context
- The BroadWorksServer contextlocation
- The location to store the object.object
- The serializable object to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(String context, File location, Serializable object) throws IOException
context
- The context as a stringlocation
- The location to store the object.object
- The serializable object to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(BroadWorksServer context, Serializable object) throws IOException
object
- The serializable object to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(BroadWorksServer context, String string) throws IOException
string
- The data to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(BroadWorksServer context, byte[] data) throws IOException
data
- The data to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(BroadWorksServer context, File location, byte[] data) throws IOException
location
- The File location.data
- The data to write.IOException
- Thrown if there is an error writing the file.public AlpacaFile get(AlpacaFileToken pathToken) throws IOException
pathToken
- The path token to retrieve.IOException
- Thrown if there is an error reading the file.public <T extends BroadWorksObjectInformation> T get(Type type, AlpacaFileToken pathToken, BroadWorksServer broadWorksServer) throws IOException, HelperException
T
- The parameterized return type determined by the type field.type
- The object information type.pathToken
- The path token to retrieve.broadWorksServer
- The BroadWorksServer to deserialize into.IOException
- Thrown if there is an error reading the file.HelperException
Copyright © 2017 ECG. All rights reserved.