Class ManagedFileAccess
java.lang.Object
org.hl7.fhir.utilities.filesystem.ManagedFileAccess
see security.md - manages access to the local file system by the FHIR HAPI Core library
By using accessPolicy, allowedPaths and accessor, a host java application can control
whether this library has direct access to the file system (and which paths it is allowed to access),
or whether the host application provides controlled access, or whether no access is allowed at all
(in which case other information providers need to be provided)
- Author:
- Grahame
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Filestatic CSFilesame as file() but checks case is correct when opening directly (for consistency across platforms)static Filestatic Filestatic FileOpen a file, conforming to local security policystatic Filestatic Filestatic FileInputStreamThis doesn't do anything, but it's useful for it to exist, to make code inspection easierstatic FileInputStreamOpen a FileInputStream, conforming to local security policystatic File[]static FileOutputStreamThis doesn't do anything, but it's useful for it to exist, to make code inspection easierstatic FileOutputStreamOpen a FileInputStream, conforming to local security policystatic voidsetAccessPolicy(ManagedFileAccess.FileAccessPolicy accessPolicy)
-
Constructor Details
-
ManagedFileAccess
public ManagedFileAccess()
-
-
Method Details
-
getAccessPolicy
-
setAccessPolicy
-
file
Open a file, conforming to local security policy- Throws:
IOException
-
file
- Throws:
IOException
-
file
- Throws:
IOException
-
csfile
- Throws:
IOException
-
csfile
- Throws:
IOException
-
inStream
Open a FileInputStream, conforming to local security policy- Throws:
IOException
-
inStream
This doesn't do anything, but it's useful for it to exist, to make code inspection easier- Parameters:
file-- Returns:
- Throws:
FileNotFoundException
-
outStream
Open a FileInputStream, conforming to local security policy- Throws:
IOException
-
outStream
This doesn't do anything, but it's useful for it to exist, to make code inspection easier- Parameters:
file-- Returns:
- Throws:
FileNotFoundException
-
csfile
same as file() but checks case is correct when opening directly (for consistency across platforms)- Throws:
IOException
-
fromPath
- Throws:
IOException
-
listFiles
- Throws:
IOException
-