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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NuclosFileOpens and reads the data from the given file and returns a newNuclosFilewith the same filename and content.static NuclosFileOpens and reads the data from the file the given filename points to and returns a newNuclosFilewith the same filename and content.static NuclosFileReturns a newNuclosFilewith the given filename and content.static voidprint(NuclosFile file) This method sends aNuclosFileto the default printerstatic voidprint(NuclosFile file, String printername) This method sends aNuclosFileto the given printerstatic voidprint(NuclosFile file, PrintProperties printProperties) This method prints aNuclosFilewith the givenPrintPropertiesstatic voidsave(NuclosFile file, String directory) This method saves aNuclosFilein the given directoryvoidsetFileService(FileService repService) static NuclosFiletoPdf(NuclosFile file) Transforms the given file to PDF.
-
Constructor Details
-
FileProvider
public FileProvider()
-
-
Method Details
-
setFileService
-
print
This method sends aNuclosFileto the default printer- Parameters:
file-NuclosFile- file to print- Throws:
BusinessException
-
print
This method sends aNuclosFileto the given printer- Parameters:
file-NuclosFile- file to printprintername-- Throws:
BusinessException
-
print
This method prints aNuclosFilewith the givenPrintProperties- Parameters:
file-NuclosFile- file to printprintProperties-PrintProperties- print properties to select the printer, copies etc.- Throws:
BusinessException
-
save
This method saves aNuclosFilein the given directory- Parameters:
file-NuclosFile- file to savedirectory- - directory to save file in- Throws:
BusinessException
-
newFile
Returns a newNuclosFilewith the given filename and content.- Parameters:
fileName-content-- Returns:
- Throws:
BusinessException
-
newFile
Opens and reads the data from the given file and returns a newNuclosFilewith 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 newNuclosFilewith 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
-