function renamefile(){ var from = new DirectoryEntry("images", "/sdcard/LMS_APP/images"); var to = new DirectoryEntry(".images", "/sdcard/LMS_APP"); from.moveTo(to, ".images", success, failure); }
/* Move /sdcard/Songs to /sdcard/Songs123 */ function renamefile(){ var from = new DirectoryEntry("Songs", "/sdcard/Songs"); var to = new DirectoryEntry("Songs123", "/sdcard"); from.moveTo(to, "Songs123", success, failure); }
DirectoryEntry entry = new DirectoryEntry("LDAP://OurDomain"); DirectorySearcher Dsearch = new DirectorySearcher(entry); Dsearch.Filter = "(SAMAccountName=" + UserID + ")"; Dsearch.PropertiesToLoad.Add("cn");
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentName = currentText.toString().trim(); if (currentName.equals("")) currentName = null; } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentName)); } currentText = new StringBuilder(); }
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentName = currentText.toString().trim(); if (currentName.equals("")) currentName = null; } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentName)); } currentText = new StringBuilder(); }
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentName = currentText.toString().trim(); if (currentName.equals("")) currentName = null; } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentName)); } currentText = new StringBuilder(); }
import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class TestFileScanner { public static void main(String[] args) { Scanner fileIn = null; List<DirectoryEntry> enrties = new ArrayList<>(25); try { fileIn = new Scanner(new File("directory.txt")); while (fileIn.hasNextLine()) { String line = fileIn.nextLine(); // Parse the individual line elements... DirectoryEntry de = new DirectoryEntry(...); enrties.add(de); } } catch (FileNotFoundException ex) { ex.printStackTrace(); } } }
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentFileName = currentText.toString().trim(); if (currentFileName.equals("")) currentFileName = null; } else if (qName.equals("Name")) { currentName = currentText.toString().trim(); } else if (qName.equals("Value")) { if (currentName.equals("size")) { currentSize = Long.parseLong(currentText.toString().trim()); } } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentFileName, currentSize)); } currentText.setLength(0); }
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentFileName = currentText.toString().trim(); if (currentFileName.equals("")) currentFileName = null; } else if (qName.equals("Name")) { currentName = currentText.toString().trim(); } else if (qName.equals("Value")) { if (currentName.equals("size")) { currentSize = Long.parseLong(currentText.toString().trim()); } } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentFileName, currentSize)); } currentText.setLength(0); }
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentFileName = currentText.toString().trim(); if (currentFileName.equals("")) currentFileName = null; } else if (qName.equals("Name")) { currentName = currentText.toString().trim(); } else if (qName.equals("Value")) { if (currentName.equals("size")) { currentSize = Long.parseLong(currentText.toString().trim()); } else if (currentName.equals("mtime")) { currentModificationTime = dateService.iso8601DateOrSecondsDateParse(currentText.toString().trim()); } } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentFileName, currentSize, currentModificationTime)); } currentText.setLength(0); }
public void endElement(String uri, String name, String qName) { if (qName.equals("ObjectID")) { currentObjectId = currentText.toString().trim(); } else if (qName.equals("FileType")) { currentType = FileType.fromValue(currentText.toString().trim()); } else if (qName.equals("Filename")) { currentFileName = currentText.toString().trim(); if (currentFileName.equals("")) currentFileName = null; } else if (qName.equals("Name")) { currentName = currentText.toString().trim(); } else if (qName.equals("Value")) { if (currentName.equals("size")) { currentSize = Long.parseLong(currentText.toString().trim()); } else if (currentName.equals("mtime")) { currentModificationTime = dateService.iso8601DateOrSecondsDateParse(currentText.toString().trim()); } } else if (qName.equals("DirectoryEntry")) { entries.add(new DirectoryEntry(currentObjectId, currentType, currentFileName, currentSize, currentModificationTime)); } currentText.setLength(0); }
protected Set<DirectoryEntry> values() { Builder<DirectoryEntry> expected = ImmutableSet.builder(); expected.add(new DirectoryEntry("4980cdb2a411106a04a4538c92a1b204ad92077de6e3", FileType.DIRECTORY, "adriancole-blobstore-2096685753")); expected.add(new DirectoryEntry("4980cdb2a410105404980d99e53a0504ad93939e7dc3", FileType.DIRECTORY, "adriancole-blobstore247496608")); return expected.build(); } }
protected Set<DirectoryEntry> values() { Builder<DirectoryEntry> expected = ImmutableSet.builder(); expected.add(new DirectoryEntry("4980cdb2a411106a04a4538c92a1b204ad92077de6e3", FileType.DIRECTORY, "adriancole-blobstore-2096685753", 0)); expected.add(new DirectoryEntry("4980cdb2a410105404980d99e53a0504ad93939e7dc3", FileType.DIRECTORY, "adriancole-blobstore247496608", 0)); return expected.build(); } }
public void testApplyInputStreamBase() { InputStream is = getClass().getResourceAsStream("/list_basic.xml"); ParseSax<Set<DirectoryEntry>> parser = createParser(); Set<DirectoryEntry> expected = Sets.newTreeSet(); expected.add(new DirectoryEntry("4980cdb2a411106a04a4538c92a1b204ad92077de6e3", FileType.DIRECTORY, "adriancole-blobstore-2096685753")); expected.add(new DirectoryEntry("4980cdb2a410105404980d99e53a0504ad93939e7dc3", FileType.DIRECTORY, "adriancole-blobstore247496608")); Set<DirectoryEntry> result = parser.parse(is); assertEquals(result, expected); } }
public void testApplyInputStreamBase() { InputStream is = getClass().getResourceAsStream("/list_basic.xml"); ParseSax<Set<DirectoryEntry>> parser = createParser(); Set<DirectoryEntry> expected = Sets.newTreeSet(); expected.add(new DirectoryEntry("4980cdb2a411106a04a4538c92a1b204ad92077de6e3", FileType.DIRECTORY, "adriancole-blobstore-2096685753", 0)); expected.add(new DirectoryEntry("4980cdb2a410105404980d99e53a0504ad93939e7dc3", FileType.DIRECTORY, "adriancole-blobstore247496608", 0)); Set<DirectoryEntry> result = parser.parse(is); assertEquals(result, expected); } }
public DirectoryEntry apply(StorageMetadata from) { FileType type = (from.getType() == StorageType.FOLDER || from.getType() == StorageType.RELATIVE_PATH) ? FileType.DIRECTORY : FileType.REGULAR; return new DirectoryEntry(from.getProviderId(), type, from.getName()); }
public DirectoryEntry apply(StorageMetadata from) { FileType type = (from.getType() == StorageType.FOLDER || from.getType() == StorageType.RELATIVE_PATH) ? FileType.DIRECTORY : FileType.REGULAR; return new DirectoryEntry(from.getProviderId(), type, from.getName(), from.getSize()); }
WindowsFakeFileSystem fileSystem = new WindowsFakeFileSystem(); fileSystem.add(new DirectoryEntry("C:\\home")); fileSystem.add(new FileEntry("C:\\a\\ftp\\some_file.xml", "windows absolute path"));
"/home/remote")); UnixFakeFileSystem fileSystem = new UnixFakeFileSystem(); fileSystem.add(new DirectoryEntry("/home/remote")); fileSystem.add(new FileEntry("/a/ftp/some_file.xml", "Unix absolute path"));