Class WebFile

    • Constructor Detail

      • WebFile

        public WebFile()
    • Method Detail

      • getSite

        public WebSite getSite()
        Returns the WebSite.
      • setSite

        protected void setSite​(WebSite aSite)
        Sets the WebSite.
      • getURL

        public WebURL getURL()
        Returns the URL for this file.
      • createURL

        protected WebURL createURL()
        Creates a URL for this file.
      • getPath

        public java.lang.String getPath()
        Returns the file path.
      • setPath

        public void setPath​(java.lang.String aPath)
        Sets the file path.
      • getName

        public java.lang.String getName()
        Returns the resource name.
      • getSimpleName

        public java.lang.String getSimpleName()
        Returns the file simple name.
      • getPresentableName

        public java.lang.String getPresentableName()
        Returns the Filename without extension, and with underscores replaced with spaces
      • getType

        public java.lang.String getType()
        Returns the file type (extension without the '.').
      • getDirPath

        public java.lang.String getDirPath()
        Returns the path as a directory (with trailing separator).
      • getExists

        public boolean getExists()
        Returns whether file exists in data source (has been saved and, if so, not deleted).
      • getExists

        public boolean getExists​(boolean doConfirm)
        Returns whether file exists in data source (with option to confirm if file was created instead of fetched).
      • setExists

        protected void setExists​(boolean aFlag)
        Sets whether file exists in data source (has been saved and, if so, not deleted).
      • getParent

        public WebFile getParent()
        Returns the file parent directory.
      • setParent

        protected void setParent​(WebFile aFile)
        Sets the file parent.
      • getModifiedTime

        public long getModifiedTime()
        Returns the file modification time.
      • setModifiedTime

        public void setModifiedTime​(long aTime)
        Sets the file modification time.
      • getModifiedDate

        public java.util.Date getModifiedDate()
        Returns the modified date.
      • isFile

        public boolean isFile()
        Returns whether resource is a directory.
      • isDirectory

        public boolean isDirectory()
        Returns whether resource is a directory.
      • setDirectory

        public void setDirectory​(boolean aValue)
        Sets whether resource is a directory.
      • getSize

        public long getSize()
        Returns the file size.
      • setSize

        public void setSize​(long aSize)
        Sets the file size.
      • getContentResponse

        protected Response getContentResponse()
        Returns files for path.
      • isBytesSet

        public boolean isBytesSet()
        Returns whether bytes have been set/loaded for file.
      • getBytes

        public byte[] getBytes()
        Returns the file bytes.
      • setBytes

        public void setBytes​(@Nullable
                             byte[] theBytes)
        Sets the file bytes.
      • getFileCount

        public int getFileCount()
        Returns the number of files in this directory.
      • getFile

        public WebFile getFile​(int anIndex)
        Returns the individual file at given index.
      • getFiles

        public <T extends WebFile> java.util.List<T> getFiles()
        Returns the directory files list.
      • setFiles

        protected void setFiles​(java.util.List theFiles)
        Sets the directory files list.
      • initFiles

        protected void initFiles()
        Initialize files.
      • initFiles

        protected void initFiles​(java.util.List<? extends WebFile> theFiles)
        Initialize files.
      • addFile

        protected void addFile​(WebFile aFile)
        Adds a file.
      • addFile

        protected void addFile​(WebFile aFile,
                               int anIndex)
        Adds a file at given index.
      • removeFile

        protected WebFile removeFile​(int anIndex)
        Removes a file at given index.
      • removeFile

        protected int removeFile​(WebFile aFile)
        Removes given file.
      • createFile

        public WebFile createFile​(java.lang.String aName)
        Returns the file with the given name.
      • getFile

        public WebFile getFile​(java.lang.String aName)
        Returns the file with the given name.
      • getFiles

        public java.util.List<WebFile> getFiles​(java.lang.String aRegex)
        Returns the list of files that match given regex.
      • getFileIndex

        public int getFileIndex​(WebFile aFile)
        Returns the index of a file.
      • getInsertIndex

        public int getInsertIndex​(WebFile aFile)
        Returns the insert index to insert a file in this directory.
      • getFileNames

        public java.util.List<java.lang.String> getFileNames()
        Returns the file keys.
      • getDataType

        public DataType getDataType()
        Returns the data type of the file.
      • setDataType

        protected void setDataType​(DataType aDataType)
        Sets the data type for the file.
      • getProp

        public java.lang.Object getProp​(java.lang.String aKey)
        Returns a file property for key.
      • setProp

        public void setProp​(java.lang.String aKey,
                            java.lang.Object aValue)
        Sets a property for a key.
      • isUpdateSet

        public boolean isUpdateSet()
        Returns whether update is set and has update.
      • setUpdater

        public void setUpdater​(WebFile.Updater anUpdater)
        Sets the Updater.
      • refresh

        public void refresh()
        Revert the file from saved version.
      • isRoot

        public boolean isRoot()
        Returns whether this directory is root directory.
      • getURLString

        public java.lang.String getURLString()
        Returns the URL string for this file.
      • getText

        public java.lang.String getText()
        Returns the file bytes as a string.
      • setText

        public void setText​(java.lang.String aString)
        Sets the file bytes as a string.
      • getInputStream

        public java.io.InputStream getInputStream()
        Returns an input stream for file.
      • getStandardFile

        public java.io.File getStandardFile()
        Returns a standard java.io.File, if available.
      • getURL

        public WebURL getURL​(java.lang.String aPath)
        Returns a relative URL for the given file path.
      • createURL

        protected WebURL createURL​(java.lang.String aURL)
        Creates a URL for string.
      • equals

        public boolean equals​(java.lang.Object anObj)
        Standard equals implementation.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Standard hashCode implementation.
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(WebFile aFile)
        Standard compareTo implementation.
        Specified by:
        compareTo in interface java.lang.Comparable<WebFile>
      • getJSONKeys

        public java.util.List<java.lang.String> getJSONKeys()
        RMJSONArchiver.GetKeys implementation.
        Specified by:
        getJSONKeys in interface RMJSONArchiver.GetKeys
      • toString

        public java.lang.String toString()
        Returns a string representation of file.
        Overrides:
        toString in class RMObject