Class EssFileImpl

java.lang.Object
com.appliedolap.essbase.AbstractEssObject
com.appliedolap.essbase.impl.EssFileImpl
All Implemented Interfaces:
EssFile, EssObject
Direct Known Subclasses:
EssFolderImpl

public class EssFileImpl extends AbstractEssObject implements EssFile
A file or folder in the Essbase server file hierarchy. If a folder, the isFolder() method will return true and the instance can be cast to an EssFolderImpl.
  • Field Details

    • fullPath

      protected final String fullPath
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: EssFile
      Returns the filename portion of the file.
      Specified by:
      getName in interface EssFile
      Specified by:
      getName in interface EssObject
      Returns:
      the filename
    • getType

      public EssObject.Type getType()
      Description copied from interface: EssObject
      Gets the type of this object.
      Specified by:
      getType in interface EssFile
      Specified by:
      getType in interface EssObject
      Returns:
      the object type
    • getFullPath

      public String getFullPath()
      Description copied from interface: EssFile
      Returns the full path of the file, i.e. the combination of its path and filename.
      Specified by:
      getFullPath in interface EssFile
      Returns:
      the full path of the file
    • getPath

      public String getPath()
      Description copied from interface: EssFile
      Convenience method to return the path to the file.
      Specified by:
      getPath in interface EssFile
      Returns:
      the path of this file
    • isFolder

      public boolean isFolder()
      Description copied from interface: EssFile
      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.
      Specified by:
      isFolder in interface EssFile
      Returns:
      true if this object represents a folder, false otherwise
    • isFile

      public boolean isFile()
      Description copied from interface: EssFile
      Returns true if this is a file, not a folder.
      Specified by:
      isFile in interface EssFile
      Returns:
      true if this object is a file
    • getServer

      public EssServer getServer()
      Description copied from interface: EssFile
      Returns the owning Essbase server instance for this file.
      Specified by:
      getServer in interface EssFile
      Returns:
      the Essbase server parent object
    • download

      public File download()
      Description copied from interface: EssFile
      Downloads this file to the current directory
      Specified by:
      download in interface EssFile
      Returns:
      a local file system reference to the downloaded file
    • downloadToFolder

      public File downloadToFolder(File folder)
      Description copied from interface: EssFile
      Downloads the file to a particular folder). TODO: check if folder and download there, if not, download as specific file
      Specified by:
      downloadToFolder in interface EssFile
      Parameters:
      folder - the folder
      Returns:
      a local filesystem reference to the created file
    • downloadTo

      public File downloadTo(File file)
      Description copied from interface: EssFile
      Downloads this file to exactly the given path, whatever it is called on the server.

      Distinct from EssFile.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.

      Specified by:
      downloadTo in interface EssFile
      Parameters:
      file - where to write, created or overwritten
      Returns:
      the file written
    • delete

      public void delete()
      Description copied from interface: EssFile
      Delete this file.
      Specified by:
      delete in interface EssFile
    • lcmImport

      @Deprecated public EssJob lcmImport(boolean overwrite)
      Deprecated.
      Description copied from interface: EssFile
      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.

      Specified by:
      lcmImport in interface EssFile
      Parameters:
      overwrite - whether to overwrite what is already there, which the old version always did
      Returns:
      the submitted job
    • getDatabasesInLcmZip

      public List<String> getDatabasesInLcmZip()
      Answers with a plain string rather than a list - "Sample.Basic" or several comma separated - so it is split here. Nothing in the specification says which, only type: string.
      Specified by:
      getDatabasesInLcmZip in interface EssFile
      Returns:
      the cube names in the zip - bare names such as Basic, without the application
    • copy

      public void copy(EssFilePathDetail body, Boolean overwrite)
      Description copied from interface: EssFile
      Copy a file from source to destination.
      Specified by:
      copy in interface EssFile
      Parameters:
      body - File path details.(required)
      overwrite - Overwrite existing file. (optional, default to false)
    • move

      public void move(EssFilePathDetail body, Boolean overwrite)
      Description copied from interface: EssFile
      Moves a file from source to destination. Moving a folder is not supported
      Specified by:
      move in interface EssFile
      Parameters:
      body - File path details.(required)
      overwrite - Overwrite existing file. Only applicable for moving a file. (optional, default to false)
    • rename

      public void rename(EssFilePathDetail body, Boolean overwrite)
      Description copied from interface: EssFile
      Renames a file or folder. Renaming a folder is supported only if the folder is not in the applications directory
      Specified by:
      rename in interface EssFile
      Parameters:
      body - File path details.(required)
      overwrite - Overwrite existing file. Only applicable for renaming a file. (optional, default to false)
    • extract

      public void extract(EssZipFileDetails body, Boolean overwrite)
      Description copied from interface: EssFile
      Extract a zip file on same location. Supported for applications, users, and shared folders.
      Specified by:
      extract in interface EssFile
      Parameters:
      body - File path details.(required)
      overwrite - Overwrite existing file. Not applicable for folder. (optional, default to false)