Tabnine Logo
LocalNotfoundException
Code IndexAdd Tabnine to your IDE (free)

How to use
LocalNotfoundException
in
ch.cyberduck.core.exception

Best Java code snippets using ch.cyberduck.core.exception.LocalNotfoundException (Showing top 3 results out of 315)

origin: iterate-ch/cyberduck

/**
 * Delete the file
 */
public void delete() throws AccessDeniedException, NotfoundException {
  try {
    Files.delete(Paths.get(path));
  }
  catch(NoSuchFileException e) {
    throw new LocalNotfoundException(String.format("Delete %s failed", path), e);
  }
  catch(IOException e) {
    throw new LocalAccessDeniedException(MessageFormat.format(
      LocaleFactory.localizedString("Cannot delete {0}", "Error"), this.getName()), e);
  }
}
origin: iterate-ch/cyberduck

public Local getSymlinkTarget() throws NotfoundException {
  try {
    try {
      Paths.get(path).toRealPath();
    }
    catch(NoSuchFileException ignore) {
      // Proceed if target is not found
    }
    catch(FileSystemException e) {
      // Too many levels of symbolic links
      log.warn(String.format("Failure resolving symlink target for %s. %s", path, e.getMessage()));
      throw new LocalNotfoundException(MessageFormat.format("Failure to read attributes of {0}", this.getName()), e);
    }
    // For a link that actually points to something (either a file or a directory),
    // the absolute path is the path through the link, whereas the canonical path
    // is the path the link references.
    final Path target = Files.readSymbolicLink(Paths.get(path));
    if(target.isAbsolute()) {
      return LocalFactory.get(target.toString());
    }
    else {
      return LocalFactory.get(this.getParent(), target.toString());
    }
  }
  catch(InvalidPathException | IOException e) {
    throw new LocalNotfoundException(MessageFormat.format("Failure to read attributes of {0}", this.getName()), e);
  }
}
origin: iterate-ch/cyberduck

private NSDictionary getNativeAttributes() throws AccessDeniedException, NotfoundException {
  if((!local.exists())) {
    throw new LocalNotfoundException(local.getAbsolute());
  }
  final ObjCObjectByReference error = new ObjCObjectByReference();
  // If flag is true and path is a symbolic link, the attributes of the linked-to file are returned;
  // if the link points to a nonexistent file, this method returns null. If flag is false,
  // the attributes of the symbolic link are returned.
  final NSDictionary dict = NSFileManager.defaultManager().attributesOfItemAtPath_error(
    local.getAbsolute(), error);
  if(null == dict) {
    final NSError f = error.getValueAs(NSError.class);
    if(null == f) {
      throw new LocalAccessDeniedException(local.getAbsolute());
    }
    throw new LocalAccessDeniedException(String.format("%s", f.localizedDescription()));
  }
  return dict;
}
ch.cyberduck.core.exceptionLocalNotfoundException

Most used methods

  • <init>

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BoxLayout (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now