public class FileProvider
extends java.lang.Object
FileProvider
consists various methods for file-operation
This class is usually used in Rule-classes and allows API access only
Constructor and Description |
---|
FileProvider() |
Modifier and Type | Method and Description |
---|---|
static NuclosFile |
newFile(java.io.File file)
Opens and reads the data from the given file and returns a new
NuclosFile with the same filename and content. |
static NuclosFile |
newFile(java.lang.String completeFilename)
Opens and reads the data from the file the given filename points to and returns a new
NuclosFile with the same filename and content. |
static NuclosFile |
newFile(java.lang.String fileName,
byte[] content)
Returns a new
NuclosFile with the given filename and content. |
static void |
print(NuclosFile file)
This method sends a
NuclosFile to the default printer |
static void |
print(NuclosFile file,
PrintProperties printProperties)
This method prints a
NuclosFile with the given PrintProperties |
static void |
print(NuclosFile file,
java.lang.String printername)
This method sends a
NuclosFile to the given printer |
static void |
save(NuclosFile file,
java.lang.String directory)
This method saves a
NuclosFile in the given directory |
void |
setFileService(FileService repService) |
static NuclosFile |
toPdf(NuclosFile file)
Transforms the given file to PDF.
|
public void setFileService(FileService repService)
public static void print(NuclosFile file) throws BusinessException
NuclosFile
to the default printerfile
- NuclosFile
- file to printBusinessException
public static void print(NuclosFile file, java.lang.String printername) throws BusinessException
NuclosFile
to the given printerfile
- NuclosFile
- file to printprintername
- BusinessException
public static void print(NuclosFile file, PrintProperties printProperties) throws BusinessException
NuclosFile
with the given PrintProperties
file
- NuclosFile
- file to printprintProperties
- PrintProperties
- print properties to select the printer, copies etc.BusinessException
public static void save(NuclosFile file, java.lang.String directory) throws BusinessException
NuclosFile
in the given directoryfile
- NuclosFile
- file to savedirectory
- - directory to save file inBusinessException
public static NuclosFile newFile(java.lang.String fileName, byte[] content) throws BusinessException
NuclosFile
with the given filename and content.fileName
- content
- BusinessException
public static NuclosFile newFile(java.io.File file) throws BusinessException
NuclosFile
with the same filename and content.
Argument file must be of type filefile
- BusinessException
public static NuclosFile newFile(java.lang.String completeFilename) throws BusinessException
NuclosFile
with the same filename and content.
Argument completeFilename must include path and filenamecompleteFilename
- BusinessException
public static NuclosFile toPdf(NuclosFile file) throws BusinessException
file
- BusinessException
Copyright © 2024. All rights reserved.