Package com.iizix.wsfile
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 SummaryModifier and TypeMethodDescription- boolean- delete()Unpublishes and deletes the file, including a potential database backup of the file.Gets the file description.- getFile()Gets the file, regardless of existence or published state.Gets the file name.Gets the URL, i.e.- getID()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.- booleanReturns whether the file is published or not.- boolean- publish()Starts publishing the file on the web server.- booleanStops publishing the file on the web server.
- Method Details- getFileFile getFile()Gets the file, regardless of existence or published state.- Returns:
- The file, never null.
 
- getFileNameString getFileName()Gets the file name.- Returns:
- The file name with file extension of the file resource on disk, without path.
 
- getURLNameString 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.
 
- getDescriptionString getDescription()Gets the file description.
- getIDObject getID()Gets the ID used for databases.- Returns:
- The ID as a LongorString, ornullwhen no database is present or an ID is not required.
 
- getPublishedFileFile getPublishedFile()Returns the publish file for access from the web server.- Returns:
- The file published, or null for unpublished or non-existent.
 
- publishStarts 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.
 
- unpublishboolean 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.
 
- isPublishedboolean isPublished()Returns whether the file is published or not.- Returns:
- true if published to the web server, false otherwise.
 
- deleteUnpublishes 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.
 
- getFullTargetURLString 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.