private boolean findTarget(final Local target, final Local root) { return target.equals(root) || target.isChild(root); } }
protected boolean matches(final Local context, final Local file) { if(!new File(context.getAbsolute()).isAbsolute()) { return context.getName().equals(file.getName()); } return this.normalize(context).equals(this.normalize(file)); }
public void copy(final Local copy, final CopyOptions options) throws AccessDeniedException { if(copy.equals(this)) { log.warn(String.format("%s and %s are identical. Not copied.", this.getName(), copy.getName())); } else { if(log.isDebugEnabled()) { log.debug(String.format("Copy to %s with options %s", copy, options)); } InputStream in = null; OutputStream out = null; try { in = this.getInputStream(); out = copy.getOutputStream(options.append); IOUtils.copy(in, out); } catch(IOException e) { throw new LocalAccessDeniedException(MessageFormat.format( LocaleFactory.localizedString("Cannot copy {0}", "Error"), this.getName()), e); } finally { IOUtils.closeQuietly(in); IOUtils.closeQuietly(out); } } }
iter.remove(); if(download.local.equals(n.local)) {
final boolean dock = destination.equals(LocalFactory.get("~/Library/Caches/TemporaryItems")); if(dock) { for(Path p : pasteboard) {
final Transfer transfer = reader.read(f); if(!this.getFile(transfer).equals(f)) { this.rename(f, transfer);
private void addDownloadPath(final Local f) { this.downloadPathPopup.addItemWithTitle(f.getDisplayName()); this.downloadPathPopup.lastItem().setImage( IconCacheFactory.<NSImage>get().fileIcon(f, 16) ); this.downloadPathPopup.lastItem().setRepresentedObject(f.getAbbreviatedPath()); if(DEFAULT_DOWNLOAD_FOLDER.equals(f)) { this.downloadPathPopup.selectItem(this.downloadPathPopup.lastItem()); } }
private void addDownloadPath(final Local f) { if(downloadPathPopup.menu().itemWithTitle(f.getDisplayName()) == null) { downloadPathPopup.addItemWithTitle(f.getDisplayName()); downloadPathPopup.lastItem().setImage(IconCacheFactory.<NSImage>get().fileIcon(f, 16)); downloadPathPopup.lastItem().setRepresentedObject(f.getAbsolute()); if(new DownloadDirectoryFinder().find(bookmark).equals(f)) { downloadPathPopup.selectItem(downloadPathPopup.lastItem()); } } }