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 void
generateFile(java.lang.String fileName, java.io.InputStream content)
Writes binary data to disk.boolean
isFile(java.lang.String path)
Tests whether the file exists at the location in the default output configuration.boolean
isFile(java.lang.String path, java.lang.String outputConfigurationName)
Tests whether the file exists at the location denoted by the output configuration.java.io.InputStream
readBinaryFile(java.lang.String fileName)
Creates an InputStream to read a binary file from disk.java.lang.CharSequence
readTextFile(java.lang.String fileName)
Reads a text file from disk.void
setContext(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:IFileSystemAccessExtension3
Writes binary data to disk. For writing text, it is recommended to useIFileSystemAccess.generateFile(String, CharSequence)
- Specified by:
generateFile
in interfaceIFileSystemAccessExtension3
- Since:
- 2.4
-
readBinaryFile
public java.io.InputStream readBinaryFile(java.lang.String fileName)
Description copied from interface:IFileSystemAccessExtension3
Creates an InputStream to read a binary file from disk. For text files, useIFileSystemAccessExtension3.readTextFile(String)
.- Specified by:
readBinaryFile
in interfaceIFileSystemAccessExtension3
- Since:
- 2.4
-
readTextFile
public java.lang.CharSequence readTextFile(java.lang.String fileName)
Description copied from interface:IFileSystemAccessExtension3
Reads a text file from disk. To read a binary file, useIFileSystemAccessExtension3.readBinaryFile(String)
.- Specified by:
readTextFile
in 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, butResource
is usually a good fit.- Since:
- 2.8
-
isFile
public boolean isFile(java.lang.String path) throws org.eclipse.xtext.util.RuntimeIOException
Description copied from interface:IFileSystemAccess2
Tests whether the file exists at the location in the default output configuration. Returnstrue
if the file at the described location exists and is a normal file (not a directory). Otherwisefalse
.- Specified by:
isFile
in interfaceIFileSystemAccess2
- Parameters:
path
- using '/' as path separator- Returns:
true
when the file at the given path exists and is a normal file. Will returnfalse
when 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.RuntimeIOException
Description copied from interface:IFileSystemAccess2
Tests whether the file exists at the location denoted by the output configuration. Returnstrue
if the file at the described location exists and is a normal file (not a directory). Otherwisefalse
.- Specified by:
isFile
in interfaceIFileSystemAccess2
- Parameters:
path
- using '/' as path separatoroutputConfigurationName
- the name of the output configuration- Returns:
true
when the file at the given path exists and is a normal file. Will returnfalse
when the path belongs to a directory.- Throws:
org.eclipse.xtext.util.RuntimeIOException
- Since:
- 2.9
-
-