public class FileManager extends Object
Modifier and Type | Method and Description |
---|---|
AlpacaFile |
get(String pathToken)
Gets the AlpacaFile given the provided path token.
|
<T extends BroadWorksObjectInformation> |
get(Type type,
String pathToken,
co.ecg.alpaca.toolkit.model.BroadWorksServer broadWorksServer)
Gets the BroadWorksObjectInformation at the provided path token.
|
List<AlpacaFileToken> |
getFileList()
Retrieves the list of AlpacaFileTokens in the root directory
|
File |
getLocation(String fileName)
Retrieves an available file location with the given file name.
|
static FileManager |
getManager() |
File |
getUnorderedLocation()
Retrieves a randomly available location within the FileManager
|
AlpacaFileToken |
put(byte[] data)
Puts the provided byte array data into a file on the file system.
|
AlpacaFileToken |
put(File location,
byte[] data)
Puts the provided byte array data at the specific file location on the system.
|
AlpacaFileToken |
put(File location,
Serializable object)
Puts the provided String data into a file on the file system.
|
AlpacaFileToken |
put(Serializable object)
Puts the provided String data into a file on the file system.
|
AlpacaFileToken |
put(String string)
Puts the provided String data into a file on the file system.
|
AlpacaFileToken |
put(String fileName,
String string)
Puts the provided String data into a file with the desired file name on the file system.
|
public static FileManager getManager() throws HelperException
HelperException
public File getLocation(String fileName)
fileName
- The desired file namepublic File getUnorderedLocation()
public AlpacaFileToken put(String fileName, String string) throws IOException
fileName
- The fileName to store.string
- The data to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(File location, Serializable object) throws IOException
location
- 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(Serializable object) throws IOException
object
- The serializable object to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(String string) throws IOException
string
- The data to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(byte[] data) throws IOException
data
- The data to store.IOException
- Thrown if there is an error writing the file.public AlpacaFileToken put(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(String 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, String pathToken, co.ecg.alpaca.toolkit.model.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
public List<AlpacaFileToken> getFileList()
Copyright © 2016. All rights reserved.