Class JavaIoFileSystemAccess

    • Method Detail

      • withCallBack

        public java.lang.Runnable withCallBack​(JavaIoFileSystemAccess.IFileCallback callBack)
        Adds the given callback to this FSA. The returned runnable allows to reset it to its previous state.
        Since:
        2.29
      • generateFile

        public void generateFile​(java.lang.String fileName,
                                 java.lang.String outputConfigName,
                                 java.lang.CharSequence contents)
                          throws org.eclipse.xtext.util.RuntimeIOException
        Parameters:
        fileName - using '/' as file separator
        outputConfigName - the name of the output configuration
        contents - the to-be-written contents.
        Throws:
        org.eclipse.xtext.util.RuntimeIOException
      • generateTrace

        protected void generateTrace​(java.lang.String generatedFile,
                                     java.lang.String outputConfigName,
                                     java.lang.CharSequence contents)
      • isWriteTrace

        public boolean isWriteTrace()
        Since:
        2.4
      • setWriteTrace

        public void setWriteTrace​(boolean writeTrace)
        Since:
        2.4
      • getEncoding

        protected java.lang.String getEncoding​(org.eclipse.emf.common.util.URI fileURI)
        Since:
        2.3
      • getFile

        protected java.io.File getFile​(java.lang.String fileName,
                                       java.lang.String outputConfigName)
        Since:
        2.1
      • createFolder

        protected void createFolder​(java.io.File parent)
      • toSystemFileName

        protected java.lang.String toSystemFileName​(java.lang.String fileName)
      • getURI

        public org.eclipse.emf.common.util.URI getURI​(java.lang.String fileName,
                                                      java.lang.String outputConfiguration)
        Description copied from interface: IFileSystemAccessExtension2
        Returns an URI for the specified path. For workspace resources a platform:/resource URI should be returned in order to pick up project specific preferences.
        Since:
        2.3
      • generateFile

        public void generateFile​(java.lang.String fileName,
                                 java.lang.String outputCfgName,
                                 java.io.InputStream content)
                          throws org.eclipse.xtext.util.RuntimeIOException
        Description copied from interface: IFileSystemAccessExtension3
        Writes binary data to disk. For writing text, it is recommended to use IFileSystemAccess.generateFile(String, String, CharSequence)
        Throws:
        org.eclipse.xtext.util.RuntimeIOException
        Since:
        2.4
      • readBinaryFile

        public java.io.InputStream readBinaryFile​(java.lang.String fileName,
                                                  java.lang.String outputCfgName)
                                           throws org.eclipse.xtext.util.RuntimeIOException
        Description copied from interface: IFileSystemAccessExtension3
        Creates an InputStream to read a binary file from disk. For text files, use IFileSystemAccessExtension3.readTextFile(String, String) .
        Throws:
        org.eclipse.xtext.util.RuntimeIOException
        Since:
        2.4
      • isFile

        public boolean isFile​(java.lang.String path,
                              java.lang.String outputConfigurationName)
                       throws org.eclipse.xtext.util.RuntimeIOException
        Tests whether the file exists at the location denoted by the output configuration. Returns true if the file at the described location exists and is a normal file (not a directory). Otherwise false.
        Specified by:
        isFile in interface IFileSystemAccess2
        Overrides:
        isFile in class AbstractFileSystemAccess2
        Parameters:
        path - using '/' as path separator
        outputConfigurationName - the name of the output configuration
        Returns:
        true when the file at the given path exists and is a normal file. Will return false when the path belongs to a directory.
        Throws:
        org.eclipse.xtext.util.RuntimeIOException