This class also used in (click to expand):
Archive.getArchive(boolean)
Attachment.toFile()
Attachment.updateContent(File)
AudioFile.copy()
AudioFile.decrypt(String, String)
AudioFile.encrypt(String)
AudioFile.pgpDecrypt(File, String, String)
AudioFile.pgpEncrypt(File)
AudioFile.removeSignature()
AudioFile.sign()
Buffer.appendFile(File)
Buffer.toBinaryFile(String, String)
Buffer.toFile(String)
CacheManager.cacheFile(File, String, int)
CacheManager.getCachedFile(String)
Cell.getFile()
Cell.setFile(File)
Data.toFile()
DataList.toFile(String, String)
DataSetRecord.setFile(String, File)
DataViewList.toFile(String, String)
DatasetFile.copy()
DatasetFile.decrypt(String, String)
DatasetFile.encrypt(String)
DatasetFile.pgpDecrypt(File, String, String)
DatasetFile.pgpEncrypt(File)
DatasetFile.removeSignature()
DatasetFile.sign()
Document.addFile(File, String, String, String, boolean)
Document.insertImage(String, File)
Document.proxySign(String, String, File)
Document.softAudioSign(String, File)
Document.softImageSign(String, File)
DocumentFile.copy()
DocumentFile.decrypt(String, String)
DocumentFile.encrypt(String)
DocumentFile.pgpDecrypt(File, String, String)
DocumentFile.pgpEncrypt(File)
DocumentFile.removeSignature()
DocumentFile.sign()
DownloadResponse.setFileContent(File)
Email.addFile(File)
EncryptionUtil.hmacSha1(String, File, boolean)
EncryptionUtil.md5(File)
EncryptionUtil.md5Base16(File)
EncryptionUtil.sha1(File)
EncryptionUtil.sha1Base16(File)
EncryptionUtil.toBase16(File)
EncryptionUtil.toBase64(File)
EncryptionUtil.verifySha1RsaSignature(File, String, String)
EncryptionUtil.verifySha256RsaSignature(File, String, String)
ExcelFile.copy()
ExcelFile.decrypt(String, String)
ExcelFile.encrypt(String)
ExcelFile.pgpDecrypt(File, String, String)
ExcelFile.pgpEncrypt(File)
ExcelFile.removeSignature()
ExcelFile.sign()
FileBuffer.getFile(String)
FileBuffer.putFile(File)
FileBuffer.toFile(String)
Fragment.toFile(String)
FtpRequest.getFile(String, boolean)
FtpRequest.getFiles(int, boolean)
FtpRequest.putFile(File)
ImageFile.copy()
ImageFile.decrypt(String, String)
ImageFile.encrypt(String)
ImageFile.pgpDecrypt(File, String, String)
ImageFile.pgpEncrypt(File)
ImageFile.removeSignature()
ImageFile.sign()
InstallerPal.addOrReplaceAttachment(String, File)
InstallerPal.addOrReplaceDocument(String, File)
InstallerPal.addOrReplaceEmail(String, File, boolean)
InstallerPal.addOrReplaceImage(String, File)
InstallerPal.addOrReplaceStyle(String, File)
InstallerPal.getAttachment(String)
InstallerPal.getAutoScript(String)
InstallerPal.getDocument(String)
InstallerPal.getEmail(String)
InstallerPal.getStyle(String)
InternalAcmeService.getCertificate()
InternalDevelopmentPal.addOrReplaceAttachment(String, File)
InternalDevelopmentPal.addOrReplaceDocument(String, File)
InternalDevelopmentPal.addOrReplaceEmail(String, File, boolean)
InternalDevelopmentPal.addOrReplaceFont(String, File)
InternalDevelopmentPal.addOrReplaceImage(String, File)
InternalDevelopmentPal.addOrReplaceStyle(String, File)
InternalDevelopmentPal.getAttachment(String)
InternalDevelopmentPal.getAutoScript(String)
InternalDevelopmentPal.getDocument(String)
InternalDevelopmentPal.getEmail(String)
InternalDevelopmentPal.getStyle(String)
InternalDevelopmentPal.toFile()
InternalDevelopmentPal.updatePal(File)
InternalEmail.addFile(File)
InternalPalInfo.getAttachment(String)
InternalPalInfo.getAutoScript(String)
InternalPalInfo.getDocument(String)
InternalPalInfo.getEmail(String)
InternalPalInfo.getStyle(String)
InternalPalInfo.toFile()
InternalStorageProvider.uploadObject(boolean, String, File)
InternalStorageProvider.uploadPublic(String, File)
InternalSystemLog.deleteLogFile(File)
InternalSystemLog.getNextLogFile()
MailResponse.getAttachments()
Message.getAttachment()
Message.setAttachment(File)
Packet.addAttachment(File, String, String)
Packet.addDocumentFromFile(File, String, String)
Packet.toFile(String, boolean, String)
PacketDataList.toFile(String, String)
Pal.getAttachment(String)
Pal.getAutoScript(String)
Pal.getDocument(String)
Pal.getEmail(String)
Pal.getStyle(String)
PdfFile.copy()
PdfFile.decrypt(String, String)
PdfFile.encrypt(String)
PdfFile.pgpDecrypt(File, String, String)
PdfFile.pgpEncrypt(File)
PdfFile.removeSignature()
PdfFile.sign()
RuntimePal.getAttachment(String)
RuntimePal.getAutoScript(String)
RuntimePal.getDocument(String)
RuntimePal.getEmail(String)
RuntimePal.getStyle(String)
SafeBox.getFile(String)
SafeBox.getFirstFile()
SafeBox.getLastFile()
SafeBox.putFile(File)
ServiceRequest.createServicePayload(File)
ServiceRequest.setFile(String, File)
ServiceResponse.getFile(String, String, String)
ServiceResponse.toFile(String)
ShellPal.addOrReplaceAttachment(String, File)
ShellPal.addOrReplaceDocument(String, File)
ShellPal.addOrReplaceEmail(String, File, boolean)
ShellPal.addOrReplaceImage(String, File)
ShellPal.addOrReplaceStyle(String, File)
ShellPal.exportShellPal()
ShellPal.getAttachment(String)
ShellPal.getAutoScript(String)
ShellPal.getDocument(String)
ShellPal.getEmail(String)
ShellPal.getStyle(String)
ShellPal.replaceFull(File, boolean)
ShellPal.replacePartial(File, boolean)
ShellPalManager.exportShellPal(String)
ShellPalManager.importShellPal(File, String, String, String)
SiteBuilder.publishWebApp(File)
SiteBuilder.putFile(String, File)
SmartDoc.getOriginal()
SmartDoc.setOriginal(File)
StorageProvider.uploadObject(boolean, String, File)
StorageProvider.uploadPublic(String, File)
StorageProviderDataList.toFile(String, String)
StoredObject.getFile(boolean)
StoredObject.setFile(File, boolean)
TiffBuilder.build()
TransactionPacket.addAttachment(File, String, String)
TransactionPacket.addDocumentFromFile(File, String, String)
TransactionPacket.toFile(String, boolean, String)
UnknownFile.toFile(String)
Upload.copy()
Upload.decrypt(String, String)
Upload.encrypt(String)
Upload.pgpDecrypt(File, String, String)
Upload.pgpEncrypt(File)
Upload.removeSignature()
Upload.sign()
VCardFile.copy()
VCardFile.decrypt(String, String)
VCardFile.encrypt(String)
VCardFile.pgpDecrypt(File, String, String)
VCardFile.pgpEncrypt(File)
VCardFile.removeSignature()
VCardFile.sign()
XMLReader.getFile(String, String, String)
XMLReader.toFile(String)
ZoneAccess.importTransaction(PalInfo, File, boolean, boolean, String)
ZoneAccess.replaceTransaction(TransactionPacket, File)
String
|
calcMD5()
Returns an MD5 checksum of the contents of this file.
|
|
closeReader()
Resets the capability to read lines to the beginning of the file.
|
File
|
copy()
Returns a copy of the file
|
FileBuffer
|
createFileBuffer()
Reads this compressed file and returns a FileBuffer. Throws exception if this not a supported type (zip and jar).
|
File
|
decrypt(String password, String filename)
Returns a new file. Assumes the content of this file is PGP encrypted.
|
File
|
encrypt(String password)
Returns a new file with the content of this file PGP encrypted. The new file's filename will be existing filename+.txt
|
File
|
encrypt(String password, String filename)
Returns a new file with the content of this file PGP encrypted having the specified file name. Extensions allowed: pgp, gpg, txt, asc. Extension is required.
|
String
|
getContentType()
Returns the content type of this file
|
String
|
getFailureMessage()
When isValid is false, contains failure message.
|
String
|
getFileExtension()
Returns the file extension. 'Myfile.doc' returns 'doc'
|
int
|
getFileLength()
Returns the size of the file in bytes.
|
int
|
getFileSize()
Returns the size of the file in kilobytes.
|
String
|
getFileType()
Returns the type of the file as specified by the upload tag or API. This may be null if the file was obtained by means other than an upload.
|
String
|
getFilename()
Returns the name of the uploaded file (without the full path).
|
DataReader
|
getReader()
Opens a data reader for this file. File type should be list compatible.
|
XMLReader
|
getXMLReader(boolean removeNamespaces)
Returns a ServicePayload for processing XML-based files. Returns null if the file is not XML.
|
boolean
|
isAdHocConversionSupported()
Returns true if the content supports immediate conversion to adhoc. See Packet.createAdHocDocument(File,...)
|
boolean
|
isCorrectType()
Returns true if the type of the file is within the specified restriction.
|
boolean
|
isDataListSupported()
Returns true if this file content can be used as a DataList. See Attachment.toDataList
|
boolean
|
isMacro()
Returns true if the content of the file contains macro.
|
boolean
|
isPdfConversionSupported()
Returns true if the content supports conversion to PDF.
|
boolean
|
isSizeExceeded()
Returns true if the size of the file exceeds the specified restriction.
|
boolean
|
isValid()
Returns true if the content of the file is valid.
|
boolean
|
isVirus()
Returns true if the content of the file contains a virus.
|
File
|
pgpDecrypt(File keyFile, String password, String filename)
Returns a new file with the content of this PGP encrypted file decrypted using the provided private key. The content type is guessed from the file name extension
|
File
|
pgpEncrypt(File keyFile)
Returns a new file with the content of this file PGP encrypted using the provided public key. The new file's filename will be existing filename+.txt
|
PacketDataList
|
readDataList(String name)
Creates a non persistent PacketDataList from the contents of this file. The contents must support DataList conversion (currently .csv and .xls). If xls, this will execute formulas. This method also takes liberties with regard to column names. If it encounters any blank column name it assumes the first row is data and renames all the columns as col0 - colN. If xls, it will also attempt to find a matching tab by name and if that fails, it will return the first tab. Throws exception if invalid or unsupported file format.
|
Payload
|
readDataLists()
Creates a Payload of PacketDataList from the contents of this file. The contents must support DataList conversion (currently .csv and .xls). If xls, this will execute formulas. This method also takes liberties with regard to column names. If it encounters any blank column name it assumes the first row is data and renames all the columns as col0 - colN. Throws exception if invalid or unsupported file format.
|
String
|
readFile()
Reads all of the text-based file and returns the content as a string. Returns null if there is no content. Throws exception if this file is not a text-based file.
|
String
|
readLine()
Reads one line (of the presumably text file) and returns it, advancing the reader to the next line for subsequent reads. Returns null if this file is not text based or there are no more lines to read. Best practice-call closeReader when finished.
|
File
|
removeSignature()
Removes the digital signature, if any.
|
|
setFilename(String newFileName)
Sets the name of the file to the specified name.
|
File
|
sign()
Applies a digital signature to the file. Content must be well formed XML.
|
AudioFile
|
toAudioFile()
Returns AudioFile created from this File. Method returns null if current file cannot be represented as an audio.
|
Data
|
toData()
Returns the content of this file as a Data object with three properties: fileName, contentType, and base64. base64 will be a Base64 encoded string of the file contents.
|
PacketDataList
|
toDataList(String name)
Creates a non persistent PacketDataList from the contents of this file. The contents must support DataList conversion (currently .csv and .xls)
|
ExcelFile
|
toExcelFile()
Returns ExcelFile created from this File. Method returns null if current file cannot be represented as an excel file.
|
ImageFile
|
toImage()
Returns ImageFile created from this File. Method returns null if current file cannot be represented as an image. The file must already be a supported image content type to use this method. If you are trying convert a PDF to an image you should just get a specified page or use toTIFF to get a multi-page TIFF file.
|
PdfFile
|
toPdf(String filename)
Converts this file to PDF if possible. Call isPdfConversionSupported() to check if file can be converted to PDF. Returns PDF file or null if PDF conversion is not supported
|
PdfFile
|
toPdf(String filename, String password)
This method expects the document to already be a PDF. Call isPdfConversionSupported() to check if file can be converted to PDF. Returns PDF file or null if PDF conversion is not supported
|
String
|
toString()
Returns a description of this object.
|
UnknownFile
|
toUnknownFile(String ext)
Converts this file to an UnknownFile (used for testing purposes).
|
VCardFile
|
toVCardFile()
Returns VCard representation of this file. Returns invalid file if current file cannot be parsed as VCard
|
Method Detail
String calcMD5()
Returns an MD5 checksum of the contents of this file.
Returns:
String
Since:
11-23-2012
closeReader()
Resets the capability to read lines to the beginning of the file.
Since:
08-13-2013
File copy()
Returns a copy of the file
Returns:
File
Since:
11-17-2011
FileBuffer createFileBuffer()
Reads this compressed file and returns a FileBuffer. Throws exception if this not a supported type (zip and jar).
Returns:
FileBuffer
Since:
08-27-2013
File decrypt(String password, String filename)
Returns a new file. Assumes the content of this file is PGP encrypted.
Parameters:
-
String
password
Required parameter.
-
String
filename
Required parameter.
Returns:
File
Since:
03-17-2014
File encrypt(String password)
Returns a new file with the content of this file PGP encrypted. The new file's filename will be existing filename+.txt
Parameters:
-
String
password
Required parameter.
Returns:
File
Since:
05-16-2011
File encrypt(String password, String filename)
Returns a new file with the content of this file PGP encrypted having the specified file name. Extensions allowed: pgp, gpg, txt, asc. Extension is required.
Parameters:
-
String
password
Required parameter.
-
String
filename
Required parameter.
Returns:
File
Since:
10-07-2016
String getContentType()
Returns the content type of this file
Returns:
String
Since:
02-03-2010
String getFailureMessage()
When isValid is false, contains failure message.
Returns:
String
Since:
04-01-2009
String getFileExtension()
Returns the file extension. 'Myfile.doc' returns 'doc'
Returns:
String
Since:
06-10-2010
int getFileLength()
Returns the size of the file in bytes.
Returns:
int
Since:
08-23-2018
int getFileSize()
Returns the size of the file in kilobytes.
Returns:
int
Since:
04-10-2007
String getFileType()
Returns the type of the file as specified by the upload tag or API. This may be null if the file was obtained by means other than an upload.
Returns:
String
Since:
04-10-2007
String getFilename()
Returns the name of the uploaded file (without the full path).
Returns:
String
Since:
11-07-2007
DataReader getReader()
Opens a data reader for this file. File type should be list compatible.
Returns:
DataReader
Since:
11-20-2019
XMLReader getXMLReader(boolean removeNamespaces)
Returns a ServicePayload for processing XML-based files. Returns null if the file is not XML.
Parameters:
Returns:
XMLReader
Since:
04-11-2023
boolean isAdHocConversionSupported()
Returns true if the content supports immediate conversion to adhoc. See Packet.createAdHocDocument(File,...)
Returns:
boolean
Since:
11-09-2009
boolean isCorrectType()
Returns true if the type of the file is within the specified restriction.
Returns:
boolean
Since:
04-10-2007
boolean isDataListSupported()
Returns true if this file content can be used as a DataList. See Attachment.toDataList
Returns:
boolean
Since:
02-03-2010
boolean isMacro()
Returns true if the content of the file contains macro.
Returns:
boolean
Since:
02-23-2010
boolean isPdfConversionSupported()
Returns true if the content supports conversion to PDF.
Returns:
boolean
Since:
03-10-2008
boolean isSizeExceeded()
Returns true if the size of the file exceeds the specified restriction.
Returns:
boolean
Since:
04-10-2007
boolean isValid()
Returns true if the content of the file is valid.
Returns:
boolean
Since:
04-10-2007
boolean isVirus()
Returns true if the content of the file contains a virus.
Returns:
boolean
Since:
04-10-2007
File pgpDecrypt(File keyFile, String password, String filename)
Returns a new file with the content of this PGP encrypted file decrypted using the provided private key. The content type is guessed from the file name extension
Parameters:
-
File
keyFile
Required parameter.
-
String
password
Required parameter.
-
String
filename
Required parameter.
Returns:
File
Since:
08-03-2016
File pgpEncrypt(File keyFile)
Returns a new file with the content of this file PGP encrypted using the provided public key. The new file's filename will be existing filename+.txt
Parameters:
-
File
keyFile
Required parameter.
Returns:
File
Since:
08-03-2016
PacketDataList readDataList(String name)
Creates a non persistent PacketDataList from the contents of this file. The contents must support DataList conversion (currently .csv and .xls). If xls, this will execute formulas. This method also takes liberties with regard to column names. If it encounters any blank column name it assumes the first row is data and renames all the columns as col0 - colN. If xls, it will also attempt to find a matching tab by name and if that fails, it will return the first tab. Throws exception if invalid or unsupported file format.
Parameters:
-
String
name
Required parameter.
Returns:
PacketDataList
Since:
06-03-2020
Payload readDataLists()
Creates a Payload of PacketDataList from the contents of this file. The contents must support DataList conversion (currently .csv and .xls). If xls, this will execute formulas. This method also takes liberties with regard to column names. If it encounters any blank column name it assumes the first row is data and renames all the columns as col0 - colN. Throws exception if invalid or unsupported file format.
Returns:
Payload
Since:
05-11-2021
String readFile()
Reads all of the text-based file and returns the content as a string. Returns null if there is no content. Throws exception if this file is not a text-based file.
Returns:
String
Since:
01-20-2015
String readLine()
Reads one line (of the presumably text file) and returns it, advancing the reader to the next line for subsequent reads. Returns null if this file is not text based or there are no more lines to read. Best practice-call closeReader when finished.
Returns:
String
Since:
08-13-2013
File removeSignature()
Removes the digital signature, if any.
Returns:
File
Since:
02-26-2016
setFilename(String newFileName)
Sets the name of the file to the specified name.
Parameters:
-
String
newFileName
- New file name including extension, which must match existing extension.
Required parameter.
Since:
06-04-2024
File sign()
Applies a digital signature to the file. Content must be well formed XML.
Returns:
File
Since:
02-26-2016
AudioFile toAudioFile()
Returns AudioFile created from this File. Method returns null if current file cannot be represented as an audio.
Returns:
AudioFile
Since:
03-09-2018
Data toData()
Returns the content of this file as a Data object with three properties: fileName, contentType, and base64. base64 will be a Base64 encoded string of the file contents.
Returns:
Data
Since:
05-16-2011
PacketDataList toDataList(String name)
Creates a non persistent PacketDataList from the contents of this file. The contents must support DataList conversion (currently .csv and .xls)
Parameters:
Returns:
PacketDataList
Since:
05-15-2010
ExcelFile toExcelFile()
Returns ExcelFile created from this File. Method returns null if current file cannot be represented as an excel file.
Returns:
ExcelFile
Since:
01-17-2022
ImageFile toImage()
Returns ImageFile created from this File. Method returns null if current file cannot be represented as an image. The file must already be a supported image content type to use this method. If you are trying convert a PDF to an image you should just get a specified page or use toTIFF to get a multi-page TIFF file.
Returns:
ImageFile
Since:
10-19-2011
PdfFile toPdf(String filename)
Converts this file to PDF if possible. Call isPdfConversionSupported() to check if file can be converted to PDF. Returns PDF file or null if PDF conversion is not supported
Parameters:
-
String
filename
- name of converted file.
Required parameter.
Returns:
PdfFile
Since:
07-04-2011
PdfFile toPdf(String filename, String password)
This method expects the document to already be a PDF. Call isPdfConversionSupported() to check if file can be converted to PDF. Returns PDF file or null if PDF conversion is not supported
Parameters:
-
String
filename
- name of converted file.
Required parameter.
-
String
password
- password if any.
Required parameter.
Returns:
PdfFile
Since:
10-05-2017
String toString()
Returns a description of this object.
Returns:
String
Since:
06-14-2007
UnknownFile toUnknownFile(String ext)
Converts this file to an UnknownFile (used for testing purposes).
Parameters:
-
String
ext
Required parameter.
Returns:
UnknownFile
Since:
08-23-2018
VCardFile toVCardFile()
Returns VCard representation of this file. Returns invalid file if current file cannot be parsed as VCard
Returns:
VCardFile
Since:
12-12-2011