Interface EssFile
- All Superinterfaces:
EssObject
- All Known Subinterfaces:
EssFolder
- All Known Implementing Classes:
EssFileImpl,EssFolderImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.appliedolap.essbase.EssObject
EssObject.Type -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(EssFilePathDetail body, Boolean overwrite) Copy a file from source to destination.voiddelete()Delete this file.download()Downloads this file to the current directorydownloadTo(File file) Downloads this file to exactly the given path, whatever it is called on the server.downloadToFolder(File folder) Downloads the file to a particular folder).voidextract(EssZipFileDetails body, Boolean overwrite) Extract a zip file on same location.The cubes inside this LCM zip, without importing it.Returns the full path of the file, i.e. the combination of its path and filename.getName()Returns the filename portion of the file.getPath()Convenience method to return the path to the file.Returns the owning Essbase server instance for this file.getType()Gets the type of this object.booleanisFile()Returns true if this is a file, not a folder.booleanisFolder()Checks if this file object represents a file or a folder.lcmImport(boolean overwrite) Restores this LCM zip, as a job.voidmove(EssFilePathDetail body, Boolean overwrite) Moves a file from source to destination.voidrename(EssFilePathDetail body, Boolean overwrite) Renames a file or folder.
-
Method Details
-
getName
String getName()Returns the filename portion of the file. -
getType
EssObject.Type getType()Description copied from interface:EssObjectGets the type of this object. -
getFullPath
String getFullPath()Returns the full path of the file, i.e. the combination of its path and filename.- Returns:
- the full path of the file
-
getPath
String getPath()Convenience method to return the path to the file.- Returns:
- the path of this file
-
isFolder
boolean isFolder()Checks if this file object represents a file or a folder. If this method returnstrue, then this class may be cast toEssFolderImpl, which is a subclass of this one.- Returns:
- true if this object represents a folder, false otherwise
-
isFile
boolean isFile()Returns true if this is a file, not a folder.- Returns:
- true if this object is a file
-
getServer
EssServer getServer()Returns the owning Essbase server instance for this file.- Returns:
- the Essbase server parent object
-
download
File download()Downloads this file to the current directory- Returns:
- a local file system reference to the downloaded file
-
downloadToFolder
Downloads the file to a particular folder). TODO: check if folder and download there, if not, download as specific file- Parameters:
folder- the folder- Returns:
- a local filesystem reference to the created file
-
downloadTo
Downloads this file to exactly the given path, whatever it is called on the server.Distinct from
downloadToFolder(File), which keeps the server's name. Worth having because the server's name is often not the one a person wants: a cube's exported workbook isBasic.xlsxin every application, so five of them in a downloads folder are five files called Basic.- Parameters:
file- where to write, created or overwritten- Returns:
- the file written
-
delete
void delete()Delete this file. -
getDatabasesInLcmZip
The cubes inside this LCM zip, without importing it.The question worth asking before an import: an LCM zip is opaque, and restoring one to find out what was in it is a poor way to discover it held the wrong application. Only meaningful on a zip produced by an LCM export.
- Returns:
- the cube names in the zip - bare names such as
Basic, without the application
-
lcmImport
Restores this LCM zip, as a job.Replaces a version that submitted the job, threw the returned record away, and caught its own failure with
printStackTrace- so an import that never ran looked exactly like one that worked, and there was nothing to poll either way. The job comes back so a caller canEssJob.waitForCompletion()and ask whether it succeeded.- Parameters:
overwrite- whether to overwrite what is already there, which the old version always did- Returns:
- the submitted job
-
copy
Copy a file from source to destination.- Parameters:
body- File path details.(required)overwrite- Overwrite existing file. (optional, default to false)
-
move
Moves a file from source to destination. Moving a folder is not supported- Parameters:
body- File path details.(required)overwrite- Overwrite existing file. Only applicable for moving a file. (optional, default to false)
-
rename
Renames a file or folder. Renaming a folder is supported only if the folder is not in the applications directory- Parameters:
body- File path details.(required)overwrite- Overwrite existing file. Only applicable for renaming a file. (optional, default to false)
-
extract
Extract a zip file on same location. Supported for applications, users, and shared folders.- Parameters:
body- File path details.(required)overwrite- Overwrite existing file. Not applicable for folder. (optional, default to false)
-