Interface AFile

    • Method Detail

      • getExtension

        java.lang.String getExtension()
        Returns the corresponding file's extension (the part after the last '.'), if there is any.
        Returns:
        this file's extension or an empty String if the file has no extension
      • isReadOnly

        boolean isReadOnly()
        Returns whether this file is read-only (meaning data can be read but not written).
        Returns:
        whether this file is read-only
      • create

        void create​(java.io.InputStream source,
                    org.eclipse.core.runtime.IProgressMonitor monitor)
        Creates this file in the file-system with data from the given InputStream.
        Parameters:
        source - provides the data to be written to the new file
        monitor - a progress monitor that is notified about this process. The monitor may be null when progress does not need to be reported.
        Throws:
        IpsException - if the file already exists or creation fails
      • getContents

        java.io.InputStream getContents()
        Returns the file's data contents as an InputStream.
        Returns:
        the file's contents
        Throws:
        IpsException - if the file can't be read
      • setContents

        void setContents​(java.io.InputStream source,
                         boolean keepHistory,
                         org.eclipse.core.runtime.IProgressMonitor monitor)
        Overwrites this file in the file-system with data from the given InputStream.
        Parameters:
        source - provides the data to be written to the new file
        keepHistory - whether to keep a history of the content (if supported by the workspace)
        monitor - a progress monitor that is notified about this process. The monitor may be null when progress does not need to be reported.
        Throws:
        IpsException - if the file can't be written or does not exist