public class TrivialFileRepo extends java.lang.Object implements FileRepo
Constructor and Description |
---|
TrivialFileRepo() |
Modifier and Type | Method and Description |
---|---|
java.io.OutputStream |
createOutputStream(java.nio.file.Path path)
This method can be used to write a file that has no counterpart outside to the FileRepo.
|
java.io.InputStream |
getInputStream(java.nio.file.Path path)
Provides access to a file on disk.
|
java.io.InputStream |
getInputStream(RuleSource ruleSource)
Provides access to the InputStream of a RuleSource.
|
java.io.InputStream |
getInputStream(java.net.URL url)
Provides access to the InputStream of a file identified by an URL.
|
void |
proofDisposed(ProofDisposedEvent e)
When a
Proof was disposed via Proof.dispose() . |
void |
proofDisposing(ProofDisposedEvent e)
When a
Proof is going to be disposed. |
void |
registerProof(Proof proof)
Register the proof in the FileRepo.
|
void |
setBaseDir(java.nio.file.Path path)
Sets the base directory of the proof, i.e.
|
void |
setBootClassPath(java.io.File path)
Sets the bootclasspath (containing available classes from the Java Class Library).
|
void |
setClassPath(java.util.List<java.io.File> classPath)
Sets the classpath.
|
void |
setJavaPath(java.lang.String javaPath)
Sets the java path (where the source files are located).
|
public java.io.InputStream getInputStream(java.nio.file.Path path) throws java.io.FileNotFoundException, java.io.IOException
FileRepo
null
if the path cannot be handled by this repository.getInputStream
in interface FileRepo
path
- the path of the filenull
java.io.FileNotFoundException
- if the file does not existjava.io.IOException
- on IO errors, e.g. if the user has no permission to read the filepublic java.io.InputStream getInputStream(RuleSource ruleSource)
FileRepo
null
if the source cannot be handled by this repository.getInputStream
in interface FileRepo
ruleSource
- the RuleSourcenull
public java.io.InputStream getInputStream(java.net.URL url) throws java.io.IOException
FileRepo
null
if the url cannot be handled by this repository.getInputStream
in interface FileRepo
url
- the URL of the filenull
java.io.IOException
- on IO errorspublic java.io.OutputStream createOutputStream(java.nio.file.Path path) throws java.io.FileNotFoundException
FileRepo
createOutputStream
in interface FileRepo
path
- the path of the file to store. The path must be relative to the base directory
of the proof package.java.io.FileNotFoundException
- if a file with the given path existspublic void proofDisposing(ProofDisposedEvent e)
ProofDisposedListener
Proof
is going to be disposed.proofDisposing
in interface ProofDisposedListener
e
- The event.public void proofDisposed(ProofDisposedEvent e)
ProofDisposedListener
Proof
was disposed via Proof.dispose()
.proofDisposed
in interface ProofDisposedListener
e
- The event.public void registerProof(Proof proof)
FileRepo
registerProof
in interface FileRepo
proof
- the proof to registerpublic void setBootClassPath(java.io.File path) throws java.lang.IllegalStateException
FileRepo
setBootClassPath
in interface FileRepo
path
- the bootclasspath to set (the method does nothing if null is given)java.lang.IllegalStateException
- if the java path is already setpublic void setClassPath(java.util.List<java.io.File> classPath) throws java.lang.IllegalStateException
FileRepo
setClassPath
in interface FileRepo
classPath
- the classpath to set (the method does nothing if null is given)java.lang.IllegalStateException
- if the java path is already setpublic void setJavaPath(java.lang.String javaPath) throws java.lang.IllegalStateException
FileRepo
setJavaPath
in interface FileRepo
javaPath
- the java path to set (the method does nothing if null is given)java.lang.IllegalStateException
- if the java path is already setpublic void setBaseDir(java.nio.file.Path path)
FileRepo
setBaseDir
in interface FileRepo
path
- The path of the base directory. If a file is given, then its parent directory is
set as base path.Copyright © 2003-2019 The KeY-Project.