@Test public void testGetDeviceInfo() throws Exception { Map<String, String> devInfo = client.getDeviceInfo(); assertFalse(devInfo.isEmpty()); assertTrue(devInfo.containsKey(AfcClient.DEVICE_INFO_KEY_FS_BLOCK_SIZE)); assertTrue(devInfo.containsKey(AfcClient.DEVICE_INFO_KEY_FS_FREE_BYTES)); assertTrue(devInfo.containsKey(AfcClient.DEVICE_INFO_KEY_FS_TOTAL_BYTES)); assertTrue(devInfo.containsKey(AfcClient.DEVICE_INFO_KEY_MODEL)); assertEquals(devInfo.get(AfcClient.DEVICE_INFO_KEY_FS_BLOCK_SIZE), "" + client.getBlockSize()); assertEquals(devInfo.get(AfcClient.DEVICE_INFO_KEY_FS_FREE_BYTES), "" + client.getFreeBytes()); assertEquals(devInfo.get(AfcClient.DEVICE_INFO_KEY_FS_TOTAL_BYTES), "" + client.getTotalBytes()); assertEquals(devInfo.get(AfcClient.DEVICE_INFO_KEY_MODEL), "" + client.getModel()); }
public Map<String, String> getDeviceInfo() { StringArrayOut infosOut = new StringArrayOut(); try { checkResult(LibIMobileDevice.afc_get_device_info(getRef(), infosOut)); StringArray list = infosOut.getValue(); Map<String, String> result = new TreeMap<String, String>(); if (list != null) { int i = 0; while (true) { String key = list.get(i++); if (key == null) { break; } String value = list.get(i++); if (value == null) { break; } result.put(key, value); } } return result; } finally { LibIMobileDevice.delete_StringArray_values_z(infosOut.getValue()); infosOut.delete(); } }
AfcClient implements AutoCloseable { public Map<String, String> getDeviceInfo() { StringArrayOut infosOut = new StringArrayOut(); try { checkResult(LibIMobileDevice.afc_get_device_info(getRef(), infosOut)); StringArray list = infosOut.getValue(); Map<String, String> result = new TreeMap<String, String>(); if (list != null) { int i = 0; while (true) { String key = list.get(i++); if (key == null) { break; } String value = list.get(i++); if (value == null) { break; } result.put(key, value); } } return result; } finally { LibIMobileDevice.delete_StringArray_values_z(infosOut.getValue()); infosOut.delete(); } } }
AfcClient implements AutoCloseable { public Map<String, String> getDeviceInfo() { StringArrayOut infosOut = new StringArrayOut(); try { checkResult(LibIMobileDevice.afc_get_device_info(getRef(), infosOut)); StringArray list = infosOut.getValue(); Map<String, String> result = new TreeMap<String, String>(); if (list != null) { int i = 0; while (true) { String key = list.get(i++); if (key == null) { break; } String value = list.get(i++); if (value == null) { break; } result.put(key, value); } } return result; } finally { LibIMobileDevice.delete_StringArray_values_z(infosOut.getValue()); infosOut.delete(); } } AfcClient(AfcClientRef ref);  AfcClient(IDevice device, LockdowndServiceDescriptor service); }
AfcClient implements AutoCloseable { public Map<String, String> getDeviceInfo() { StringArrayOut infosOut = new StringArrayOut(); try { checkResult(LibIMobileDevice.afc_get_device_info(getRef(), infosOut)); StringArray list = infosOut.getValue(); Map<String, String> result = new TreeMap<String, String>(); if (list != null) { int i = 0; while (true) { String key = list.get(i++); if (key == null) { break; } String value = list.get(i++); if (value == null) { break; } result.put(key, value); } } return result; } finally { LibIMobileDevice.delete_StringArray_values_z(infosOut.getValue()); infosOut.delete(); } } AfcClient(AfcClientRef ref);  AfcClient(IDevice device, LockdowndServiceDescriptor service); String[] readDirectory(String dir); Map<String, String> getDeviceInfo(); int getBlockSize(); long getFreeBytes(); long getTotalBytes(); String getModel(); Map<String, String> getFileInfo(String path); long fileOpen(String path, AfcFileMode mode); void fileClose(long handle); int fileRead(long handle, byte[] buffer, int offset, int count); int fileWrite(long handle, byte[] buffer, int offset, int count); void fileCopy(File localFile, String remoteFile); void removePath(String path); void removePath(String path, boolean recurse); void renamePath(String from, String to); void makeDirectory(String dir); void makeLink(AfcLinkType type, String target, String source); void upload(File localFile, final String targetPath); void upload(File localFile, final String targetPath, 
            final UploadProgressCallback callback); synchronized void dispose(); @Override void close(); static void main(String[] args); }
AfcClient implements AutoCloseable { public Map<String, String> getDeviceInfo() { StringArrayOut infosOut = new StringArrayOut(); try { checkResult(LibIMobileDevice.afc_get_device_info(getRef(), infosOut)); StringArray list = infosOut.getValue(); Map<String, String> result = new TreeMap<String, String>(); if (list != null) { int i = 0; while (true) { String key = list.get(i++); if (key == null) { break; } String value = list.get(i++); if (value == null) { break; } result.put(key, value); } } return result; } finally { LibIMobileDevice.delete_StringArray_values_z(infosOut.getValue()); infosOut.delete(); } } AfcClient(AfcClientRef ref);  AfcClient(IDevice device, LockdowndServiceDescriptor service); String[] readDirectory(String dir); Map<String, String> getDeviceInfo(); int getBlockSize(); long getFreeBytes(); long getTotalBytes(); String getModel(); Map<String, String> getFileInfo(String path); long fileOpen(String path, AfcFileMode mode); void fileClose(long handle); int fileRead(long handle, byte[] buffer, int offset, int count); int fileWrite(long handle, byte[] buffer, int offset, int count); void fileCopy(File localFile, String remoteFile); void removePath(String path); void removePath(String path, boolean recurse); void renamePath(String from, String to); void makeDirectory(String dir); void makeLink(AfcLinkType type, String target, String source); void upload(File localFile, final String targetPath); void upload(File localFile, final String targetPath, 
            final UploadProgressCallback callback); synchronized void dispose(); @Override void close(); static void main(String[] args); static final String SERVICE_NAME; static final String DEVICE_INFO_KEY_FS_TOTAL_BYTES; static final String DEVICE_INFO_KEY_FS_FREE_BYTES; static final String DEVICE_INFO_KEY_FS_BLOCK_SIZE; static final String DEVICE_INFO_KEY_MODEL; static final String FILE_INFO_KEY_ST_BIRTHTIME; static final String FILE_INFO_KEY_ST_MTIME; static final String FILE_INFO_KEY_ST_BLOCKS; static final String FILE_INFO_KEY_ST_NLINK; static final String FILE_INFO_KEY_ST_SIZE; static final String FILE_INFO_KEY_ST_IFMT; static final String FILE_INFO_KEY_LINK_TARGET; }