public final class DiskFileRepo extends AbstractFileRepo
CLASS_MATCHER, JAVA_MATCHER, KEY_MATCHER, REDUX_URL, RULES_URL, ZIP_MATCHER
Constructor and Description |
---|
DiskFileRepo(java.lang.String proofName)
Initializes a new empty DiskFileRepo.
|
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.
|
protected void |
dispose()
Clears all data in the FileRepo and marks it as disposed.
|
java.io.InputStream |
getInputStream(java.net.URL url)
Provides access to the InputStream of a file identified by an URL.
|
protected java.io.InputStream |
getInputStreamInternal(java.nio.file.Path p)
Can be used to get a direct InputStream to a file stored in the FileRepo.
|
protected java.nio.file.Path |
getSaveName(java.nio.file.Path path)
Return the save name for a given file.
|
adaptFileRefs, addFile, createDirsAndCopy, getBaseDir, getBootclasspath, getClasspath, getInputStream, getInputStream, getJavaPath, getRegisteredProofs, isDisposed, isInBootClassPath, isInJavaPath, isInternalFile, isInternalResource, proofDisposed, proofDisposing, registerProof, saveProof, setBaseDir, setBootClassPath, setClassPath, setJavaPath
public DiskFileRepo(java.lang.String proofName) throws java.io.IOException
proofName
- name of the proof (used in the naming of the temporary directory)java.io.IOException
- if an I/O error occurs, e.g. the user has not the right to create the
new temporary directorypublic java.io.InputStream getInputStream(java.net.URL url) throws java.io.IOException
FileRepo
null
if the url cannot be handled by this repository.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
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 existsprotected java.nio.file.Path getSaveName(java.nio.file.Path path)
AbstractFileRepo
getSaveName
in class AbstractFileRepo
path
- the given file (absolute or relative to the proof base directory)protected java.io.InputStream getInputStreamInternal(java.nio.file.Path p) throws java.io.FileNotFoundException
AbstractFileRepo
getInputStreamInternal
in class AbstractFileRepo
p
- the original path (outside the FileRepo) of the requested filejava.io.FileNotFoundException
- if the does not file exist, is a directory,
or can not be openedprotected void dispose()
AbstractFileRepo
dispose
in class AbstractFileRepo
Copyright © 2003-2019 The KeY-Project.