Package org.nuclos.api.provider
Class FileProvider
java.lang.Object
org.nuclos.api.provider.FileProvider
FileProvider
consists various methods for file-operation
This class is usually used in Rule-classes and allows API access only
- Author:
- Matthias Reichart
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic NuclosFile
Opens and reads the data from the given file and returns a newNuclosFile
with the same filename and content.static NuclosFile
Opens and reads the data from the file the given filename points to and returns a newNuclosFile
with the same filename and content.static NuclosFile
Returns a newNuclosFile
with the given filename and content.static void
print
(NuclosFile file) This method sends aNuclosFile
to the default printerstatic void
print
(NuclosFile file, String printername) This method sends aNuclosFile
to the given printerstatic void
print
(NuclosFile file, PrintProperties printProperties) This method prints aNuclosFile
with the givenPrintProperties
static void
save
(NuclosFile file, String directory) This method saves aNuclosFile
in the given directoryvoid
setFileService
(FileService repService) static NuclosFile
toPdf
(NuclosFile file) Transforms the given file to PDF.
-
Constructor Details
-
FileProvider
public FileProvider()
-
-
Method Details
-
setFileService
-
print
This method sends aNuclosFile
to the default printer- Parameters:
file
-NuclosFile
- file to print- Throws:
BusinessException
-
print
This method sends aNuclosFile
to the given printer- Parameters:
file
-NuclosFile
- file to printprintername
-- Throws:
BusinessException
-
print
This method prints aNuclosFile
with the givenPrintProperties
- Parameters:
file
-NuclosFile
- file to printprintProperties
-PrintProperties
- print properties to select the printer, copies etc.- Throws:
BusinessException
-
save
This method saves aNuclosFile
in the given directory- Parameters:
file
-NuclosFile
- file to savedirectory
- - directory to save file in- Throws:
BusinessException
-
newFile
Returns a newNuclosFile
with the given filename and content.- Parameters:
fileName
-content
-- Returns:
- Throws:
BusinessException
-
newFile
Opens and reads the data from the given file and returns a newNuclosFile
with the same filename and content. Argument file must be of type file- Parameters:
file
-- Returns:
- Throws:
BusinessException
-
newFile
Opens and reads the data from the file the given filename points to and returns a newNuclosFile
with the same filename and content. Argument completeFilename must include path and filename- Parameters:
completeFilename
-- Returns:
- Throws:
BusinessException
-
toPdf
Transforms the given file to PDF. Supports DOCX and ODT. PDFs are returned without manipulation. Only checks the file name to find out what to do.- Parameters:
file
-- Returns:
- Throws:
BusinessException
-