Interface FileUtil

All Known Subinterfaces:
ZebraPrinter, ZebraPrinterLinkOs
All Known Implementing Classes:
Profile

public interface FileUtil
This is an utility class for performing file operations on a device.

package test.zebra.sdk.device.examples;
 
 import com.zebra.sdk.comm.Connection;
 import com.zebra.sdk.comm.ConnectionException;
 import com.zebra.sdk.comm.TcpConnection;
 import com.zebra.sdk.device.ZebraIllegalArgumentException;
 import com.zebra.sdk.printer.ZebraPrinter;
 import com.zebra.sdk.printer.ZebraPrinterFactory;
 import com.zebra.sdk.printer.ZebraPrinterLanguageUnknownException;
 
 public class FileUtilExample {
 
     public static void main(String[] args) throws Exception {
         Connection connection = new TcpConnection("192.168.1.100", TcpConnection.DEFAULT_ZPL_TCP_PORT);
 
         try {
             connection.open();
             ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
             printer.sendFileContents("/sdcard/documents/labels/sample.lbl");
             String[] fileNames = printer.retrieveFileNames();
             for (String filename : fileNames) {
                 System.out.println(filename);
             }
         } catch (ConnectionException e) {
             e.printStackTrace();
         } catch (ZebraPrinterLanguageUnknownException e) {
             e.printStackTrace();
         } catch (ZebraIllegalArgumentException e) {
             e.printStackTrace();
         } finally {
             connection.close();
         }
     }
 }