Class EcmStorage
java.lang.Object
org.palladiosimulator.protocom.framework.java.ee.storage.EcmStorage
- All Implemented Interfaces:
IStorage
The EcmStorage class provides an IStorage implementation for the SAP HANA Cloud Document Service.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createFolder
(String path) Creates a folder.void
deleteFile
(String path) Deletes the specified file or folder.boolean
fileExists
(String path) Checks whether the specified path points to an existing file or folder.Gets the files and folders contained in the specified folder.boolean
Checks whether the specified path points to a folder.byte[]
Reads the content of the specified file.readFileAsString
(String path) Reads the content of the specified file.void
Writes data to the specified file.void
Writes data to the specified file.
-
Constructor Details
-
EcmStorage
public EcmStorage()Constructs a new EcmStorage object.
-
-
Method Details
-
createFolder
Description copied from interface:IStorage
Creates a folder.- Specified by:
createFolder
in interfaceIStorage
- Parameters:
path
- the path of the new folder- Throws:
IOException
- if an error occurred while accessing the storage
-
writeFile
Description copied from interface:IStorage
Writes data to the specified file. The file will be overwritten if it already exists.- Specified by:
writeFile
in interfaceIStorage
- Parameters:
path
- the destination pathdata
- a byte array containing the data to write- Throws:
IOException
- if an error occurred while accessing the storage
-
writeFile
Description copied from interface:IStorage
Writes data to the specified file. The file will be overwritten if it already exists.- Specified by:
writeFile
in interfaceIStorage
- Parameters:
path
- the destination pathdata
- a string containing the data to write- Throws:
IOException
- if an error occurred while accessing the storage
-
readFile
Description copied from interface:IStorage
Reads the content of the specified file.- Specified by:
readFile
in interfaceIStorage
- Parameters:
path
- the path to the file whose content will be read- Returns:
- a byte array containing the file content
- Throws:
FileNotFoundException
- if the file could not be found
-
readFileAsString
Description copied from interface:IStorage
Reads the content of the specified file.- Specified by:
readFileAsString
in interfaceIStorage
- Parameters:
path
- the path to the file whose content will be read- Returns:
- a string containing the file content
- Throws:
FileNotFoundException
- if the file could not be found
-
getFiles
Description copied from interface:IStorage
Gets the files and folders contained in the specified folder.- Specified by:
getFiles
in interfaceIStorage
- Parameters:
path
- the path whose files and folders will be returned- Returns:
- a set of file and folder names
- Throws:
IOException
- if an error occurred while accessing the storage
-
deleteFile
Description copied from interface:IStorage
Deletes the specified file or folder.- Specified by:
deleteFile
in interfaceIStorage
- Parameters:
path
- the file or folder to delete
-
isFolder
Description copied from interface:IStorage
Checks whether the specified path points to a folder. -
fileExists
Description copied from interface:IStorage
Checks whether the specified path points to an existing file or folder.- Specified by:
fileExists
in interfaceIStorage
- Parameters:
path
- the path to check- Returns:
- true if the file or folder exists, otherwise false
-