Interface IWSFile


public interface IWSFile
Interface used to hold a file for a file provider. The file has a unique name for access to the web server and can be published or unpublished.
Author:
Christopher Mindus
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Unpublishes and deletes the file, including a potential database backup of the file.
    Gets the file description.
    Gets the file, regardless of existence or published state.
    Gets the file name.
    Gets the URL, i.e.
    Gets the ID used for databases.
    Returns the publish file for access from the web server.
    Gets the unique name used for the external URL path assigned to the file.
    boolean
    Returns whether the file is published or not.
    boolean
    Starts publishing the file on the web server.
    boolean
    Stops publishing the file on the web server.
  • Method Details

    • getFile

      File getFile()
      Gets the file, regardless of existence or published state.
      Returns:
      The file, never null.
    • getFileName

      String getFileName()
      Gets the file name.
      Returns:
      The file name with file extension of the file resource on disk, without path.
    • getURLName

      String getURLName()
      Gets the unique name used for the external URL path assigned to the file.
      Returns:
      The unique external URL name without path of the file with file extension.
    • getDescription

      String getDescription()
      Gets the file description.
    • getID

      Object getID()
      Gets the ID used for databases.
      Returns:
      The ID as a Long or String, or null when no database is present or an ID is not required.
    • getPublishedFile

      File getPublishedFile()
      Returns the publish file for access from the web server.
      Returns:
      The file published, or null for unpublished or non-existent.
    • publish

      boolean publish() throws IOException
      Starts publishing the file on the web server. If the file already is published, nothing will happen.
      Returns:
      true for success, false if already published.
      Throws:
      IOException - If the file no longer exists.
    • unpublish

      boolean unpublish()
      Stops publishing the file on the web server. If the file already is unpublished or never published, nothing will happen.
      Returns:
      true for success, false if already unpublished or publisher provider is disposed of.
    • isPublished

      boolean isPublished()
      Returns whether the file is published or not.
      Returns:
      true if published to the web server, false otherwise.
    • delete

      boolean delete() throws IOException
      Unpublishes and deletes the file, including a potential database backup of the file.
      Returns:
      true for unpublish success, false if already unpublished.
      Throws:
      IOException - If the file failed to be deleted from disk and/or potential database.
    • getFullTargetURL

      String getFullTargetURL()
      Gets the URL, i.e. the path to the file in the web server for external use, without protocol and host.
      Returns:
      The path on the web server, null a file is not found or not published.