public interface FileUtilLinkOs
Modifier and Type | Method and Description |
---|---|
void |
deleteFile(String filePath)
Deletes the file from the printer.
|
void |
getObjectFromPrinter(OutputStream destinationStream,
String filePath)
Retrieves a file from the printer's file system and writes the contents of that file to destinationStream.
|
byte[] |
getObjectFromPrinter(String filePath)
Retrieves a file from the printer's file system and returns the contents of that file as a byte array.
|
void |
getObjectFromPrinterViaFtp(OutputStream destinationStream,
String filePath,
String ftpPassword)
Retrieves a file from the printer's file system via FTP and writes the contents of that file to
destinationStream.
|
byte[] |
getObjectFromPrinterViaFtp(String filePath,
String ftpPassword)
Retrieves a file from the printer's file system via FTP and returns the contents of that file as a byte array.
|
byte[] |
getPrinterDownloadableObjectFromPrinter(String filePath)
Retrieves a file from the printer's file system and returns the contents of that file as a byte array including
all necessary file wrappers for redownloading to a Zebra printer.
|
List<StorageInfo> |
getStorageInfo()
Retrieves storage information for all of the printer's available drives.
|
void |
storeFileOnPrinter(byte[] fileContents,
String fileNameOnPrinter)
Stores a file on the printer named
fileNameOnPrinter with the file contents from
fileContents using any required file wrappers. |
void |
storeFileOnPrinter(String filePath)
Stores the file on the printer using any required file wrappers.
|
void |
storeFileOnPrinter(String filePath,
String fileNameOnPrinter)
Stores the file on the printer at the specified location and name using any required file wrappers.
|
List<StorageInfo> getStorageInfo() throws ConnectionException
ConnectionException
- If there is an error connecting to the device.StorageInfo class for more information.
void storeFileOnPrinter(String filePath) throws ConnectionException, IOException, ZebraIllegalArgumentException
filePath
contains any commands which need to be processed by the
printer, use FileUtil.sendFileContents(String)
instead. These commands include download commands and any
immediate commands (~CC, ~CD, ~DB, ~DE, ~DG, ~DY, ~EG, ~HI, ~HU, ~HM, ~HQ, ~HS, ~JA, ~JB, ~JC, ~JD, ~JE, ~JF,
~JG, ~JI, ~JL, ~JN, ~JO, ~JP, ~JQ, ~JR, ~JS, ~JX, ~NC, ~NT, ~PL, ~PP, ~PR, ~PS, ~RO, ~SD, ~TA, ~WC, ~WQ, ^DF)filePath
- the full file path (e.g. "C:\\Users\\%USERNAME%\\Documents\\sample.zpl").ConnectionException
- If there is an error connecting to the device.IOException
- If there is an issue reading the fileZebraIllegalArgumentException
- If filePath cannot be used to create a printer file name.void storeFileOnPrinter(String filePath, String fileNameOnPrinter) throws ConnectionException, IOException, ZebraIllegalArgumentException
filePath
contains any commands which need to be processed by the
printer, use FileUtil.sendFileContents(String)
instead. These commands include download commands and any
immediate commands (~CC, ~CD, ~DB, ~DE, ~DG, ~DY, ~EG, ~HI, ~HU, ~HM, ~HQ, ~HS, ~JA, ~JB, ~JC, ~JD, ~JE, ~JF,
~JG, ~JI, ~JL, ~JN, ~JO, ~JP, ~JQ, ~JR, ~JS, ~JX, ~NC, ~NT, ~PL, ~PP, ~PR, ~PS, ~RO, ~SD, ~TA, ~WC, ~WQ, ^DF)filePath
- the full file path (e.g. "C:\\Users\\%USERNAME%\\Documents\\sample.zpl").fileNameOnPrinter
- the full name of the file on the printer (e.g "R:SAMPLE.ZPL").ConnectionException
- If there is an error connecting to the device.IOException
- If there is an issue reading the fileZebraIllegalArgumentException
- If fileNameOnPrinter is not a legal printer file name.void storeFileOnPrinter(byte[] fileContents, String fileNameOnPrinter) throws ConnectionException, ZebraIllegalArgumentException
fileNameOnPrinter
with the file contents from
fileContents
using any required file wrappers. fileContents
contains any commands which need to be processed by the printer,
use FileUtil.sendFileContents(String)
instead. These commands include download commands and any immediate
commands (~CC, ~CD, ~DB, ~DE, ~DG, ~DY, ~EG, ~HI, ~HU, ~HM, ~HQ, ~HS, ~JA, ~JB, ~JC, ~JD, ~JE, ~JF, ~JG, ~JI,
~JL, ~JN, ~JO, ~JP, ~JQ, ~JR, ~JS, ~JX, ~NC, ~NT, ~PL, ~PP, ~PR, ~PS, ~RO, ~SD, ~TA, ~WC, ~WQ, ^DF)fileContents
- The contents of the file to store.fileNameOnPrinter
- the full name of the file on the printer (e.g "R:SAMPLE.ZPL").ConnectionException
- If there is an error connecting to the device.ZebraIllegalArgumentException
- If fileNameOnPrinter is not a legal printer file name.void deleteFile(String filePath) throws ConnectionException
filePath
may also contain wildcards.filePath
- the location of the file on the printer. Wildcards are also accepted (e.g. "E:FORMAT.ZPL",
"E:*.*")ConnectionException
- If there is an error connecting to the device.byte[] getObjectFromPrinter(String filePath) throws ConnectionException, ZebraIllegalArgumentException
filePath
- absolute file path on the printer ("E:SAMPLE.TXT").ConnectionException
- if there is an issue communicating with the device (e.g. the connection is not
open).ZebraIllegalArgumentException
- if the filePath is invalid, or if the file does not exist on the printer.void getObjectFromPrinter(OutputStream destinationStream, String filePath) throws ConnectionException, ZebraIllegalArgumentException
destinationStream
- output stream to receive the file contentsfilePath
- absolute file path on the printer ("E:SAMPLE.TXT").ConnectionException
- if there is an issue communicating with the device (e.g. the connection is not
open).ZebraIllegalArgumentException
- if the filePath is invalid, or if the file does not exist on the printer.byte[] getObjectFromPrinterViaFtp(String filePath, String ftpPassword) throws ConnectionException, ZebraIllegalArgumentException
ftpPassword
is not provided, a default will be tried.filePath
- absolute file path on the printer ("E:SAMPLE.TXT")ftpPassword
- password used to login to FTP, if null, a default password ("1234") will be used.ConnectionException
- if there is an error communicating with the printer, or the ftpPassword is invalidZebraIllegalArgumentException
- if the filePath is invalid, or if the file does not exist on the printer.void getObjectFromPrinterViaFtp(OutputStream destinationStream, String filePath, String ftpPassword) throws ConnectionException, ZebraIllegalArgumentException
ftpPassword
is not provided, a default will be tried.destinationStream
- output stream to receive the file contentsfilePath
- absolute file path on the printer ("E:SAMPLE.TXT")ftpPassword
- password used to login to FTP, if null, a default password ("1234") will be used.ConnectionException
- if there is an error communicating with the printer, or the ftpPassword is invalidZebraIllegalArgumentException
- if the filePath is invalid, or if the file does not exist on the printer.byte[] getPrinterDownloadableObjectFromPrinter(String filePath) throws ConnectionException, ZebraIllegalArgumentException
filePath
- absolute file path on the printer ("E:SAMPLE.TXT")ConnectionException
- if there is an issue communicating with the device (e.g. the connection is not
open).ZebraIllegalArgumentException
- if the filePath is invalid, or if the file does not exist on the printer.
© 2015 ZIH Corp. All Rights Reserved.