Interface EssFile

All Superinterfaces:
EssObject
All Known Subinterfaces:
EssFolder
All Known Implementing Classes:
EssFileImpl, EssFolderImpl

public interface EssFile extends EssObject
  • Method Details

    • getName

      String getName()
      Returns the filename portion of the file.
      Specified by:
      getName in interface EssObject
      Returns:
      the filename
    • getType

      EssObject.Type getType()
      Description copied from interface: EssObject
      Gets the type of this object.
      Specified by:
      getType in interface EssObject
      Returns:
      the object type
    • 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 returns true, then this class may be cast to EssFolderImpl, 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

      File downloadToFolder(File folder)
      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

      File downloadTo(File file)
      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 is Basic.xlsx in 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

      List<String> 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

      EssJob lcmImport(boolean overwrite)
      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 can EssJob.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

      void copy(EssFilePathDetail body, Boolean overwrite)
      Copy a file from source to destination.
      Parameters:
      body - File path details.(required)
      overwrite - Overwrite existing file. (optional, default to false)
    • move

      void move(EssFilePathDetail body, Boolean overwrite)
      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

      void rename(EssFilePathDetail body, Boolean overwrite)
      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

      void extract(EssZipFileDetails body, Boolean overwrite)
      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)