private void getFilesFromSlaveDir(Vector<File> toCopy) { // get all files, do not consider extensions for (FileInfo fi : FileSyncerUtils.GetFileInfoItems(this.slaveDir)) { for (String masterRequired : this.masterDBInfos) { if (fi.getMatchName().equals(FileInfo.GetMatchName(masterRequired))) { toCopy.add(fi.getFile()); } } } }
@Override protected Boolean doInBackground() throws Exception { File targetDirFile = new File(this.targetDir); Vector<File> toCopy = new Vector<File>(); if (this.useWebsearch) { getFilesFromWebSearch(toCopy); } else { getFilesFromSlaveDir(toCopy); } FileSyncerUtils.doCopying(toCopy, targetDirFile, this.outputArea); return true; }
public void syncItemsDirBased(Vector<String> master, String slaveDir, String targetDir) { this.slaveDir = slaveDir; this.masterDBInfos = master; this.targetDir = targetDir; this.useWebsearch = false; File slaveDirFile = new File(slaveDir); File targetDirFile = new File(targetDir); if (!FileSyncerUtils.doChecking( this.masterDBInfos, slaveDirFile, targetDirFile, this.outputArea)) { return; } // output image names this.outputArea.showMessage("im album enthaltene bilder:\n", IMessageDisplay.VERBOSE); for (String s : master) { this.outputArea.showMessage(" " + s + "\n", IMessageDisplay.VERBOSE); } try { execute(); } catch (Exception e) { e.printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } }