Package org.eclipse.xtext.generator
Class AbstractFileSystemAccess2
- java.lang.Object
-
- org.eclipse.xtext.generator.AbstractFileSystemAccess
-
- org.eclipse.xtext.generator.AbstractFileSystemAccess2
-
- All Implemented Interfaces:
IFileSystemAccess,IFileSystemAccess2,IFileSystemAccessExtension,IFileSystemAccessExtension2,IFileSystemAccessExtension3
- Direct Known Subclasses:
InMemoryFileSystemAccess,JavaIoFileSystemAccess,URIBasedFileSystemAccess
public abstract class AbstractFileSystemAccess2 extends AbstractFileSystemAccess implements IFileSystemAccess2
Abstract base class for file system access supportingIFileSystemAccess2.- Since:
- 2.4
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.generator.IFileSystemAccess
DEFAULT_OUTPUT
-
-
Constructor Summary
Constructors Constructor Description AbstractFileSystemAccess2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateFile(java.lang.String fileName, java.io.InputStream content)Writes binary data to disk.booleanisFile(java.lang.String path)Tests whether the file exists at the location in the default output configuration.booleanisFile(java.lang.String path, java.lang.String outputConfigurationName)Tests whether the file exists at the location denoted by the output configuration.java.io.InputStreamreadBinaryFile(java.lang.String fileName)Creates an InputStream to read a binary file from disk.java.lang.CharSequencereadTextFile(java.lang.String fileName)Reads a text file from disk.voidsetContext(java.lang.Object context)Sets the context to further configure this file system access instance.-
Methods inherited from class org.eclipse.xtext.generator.AbstractFileSystemAccess
deleteFile, deleteFile, generateFile, getCurrentSource, getOutputConfig, getOutputConfigurations, getPathes, getURI, postProcess, postProcess, setCurrentSource, setOutputConfigurations, setOutputPath, setOutputPath
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.generator.IFileSystemAccess
deleteFile, generateFile, generateFile
-
Methods inherited from interface org.eclipse.xtext.generator.IFileSystemAccessExtension
deleteFile
-
Methods inherited from interface org.eclipse.xtext.generator.IFileSystemAccessExtension2
getURI, getURI
-
Methods inherited from interface org.eclipse.xtext.generator.IFileSystemAccessExtension3
generateFile, readBinaryFile, readTextFile
-
-
-
-
Method Detail
-
generateFile
public void generateFile(java.lang.String fileName, java.io.InputStream content)Description copied from interface:IFileSystemAccessExtension3Writes binary data to disk. For writing text, it is recommended to useIFileSystemAccess.generateFile(String, CharSequence)- Specified by:
generateFilein interfaceIFileSystemAccessExtension3- Since:
- 2.4
-
readBinaryFile
public java.io.InputStream readBinaryFile(java.lang.String fileName)
Description copied from interface:IFileSystemAccessExtension3Creates an InputStream to read a binary file from disk. For text files, useIFileSystemAccessExtension3.readTextFile(String).- Specified by:
readBinaryFilein interfaceIFileSystemAccessExtension3- Since:
- 2.4
-
readTextFile
public java.lang.CharSequence readTextFile(java.lang.String fileName)
Description copied from interface:IFileSystemAccessExtension3Reads a text file from disk. To read a binary file, useIFileSystemAccessExtension3.readBinaryFile(String).- Specified by:
readTextFilein interfaceIFileSystemAccessExtension3- Since:
- 2.4
-
setContext
public void setContext(java.lang.Object context)
Sets the context to further configure this file system access instance.- Parameters:
context- a context from which project configuration can be obtained. Supported context types depend on the concrete implementation, butResourceis usually a good fit.- Since:
- 2.8
-
isFile
public boolean isFile(java.lang.String path) throws org.eclipse.xtext.util.RuntimeIOExceptionDescription copied from interface:IFileSystemAccess2Tests whether the file exists at the location in the default output configuration. Returnstrueif the file at the described location exists and is a normal file (not a directory). Otherwisefalse.- Specified by:
isFilein interfaceIFileSystemAccess2- Parameters:
path- using '/' as path separator- Returns:
truewhen the file at the given path exists and is a normal file. Will returnfalsewhen the path belongs to a directory.- Throws:
org.eclipse.xtext.util.RuntimeIOException- Since:
- 2.9
-
isFile
public boolean isFile(java.lang.String path, java.lang.String outputConfigurationName) throws org.eclipse.xtext.util.RuntimeIOExceptionDescription copied from interface:IFileSystemAccess2Tests whether the file exists at the location denoted by the output configuration. Returnstrueif the file at the described location exists and is a normal file (not a directory). Otherwisefalse.- Specified by:
isFilein interfaceIFileSystemAccess2- Parameters:
path- using '/' as path separatoroutputConfigurationName- the name of the output configuration- Returns:
truewhen the file at the given path exists and is a normal file. Will returnfalsewhen the path belongs to a directory.- Throws:
org.eclipse.xtext.util.RuntimeIOException- Since:
- 2.9
-
-