Codota Logo
UserPrincipalNotFoundException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
java.nio.file.attribute.UserPrincipalNotFoundException
constructor

Best Java code snippets using java.nio.file.attribute.UserPrincipalNotFoundException.<init> (Showing top 10 results out of 315)

  • Common ways to obtain UserPrincipalNotFoundException
private void myMethod () {
UserPrincipalNotFoundException u =
  • Codota IconString str;new UserPrincipalNotFoundException(str)
  • Smart code suggestions by Codota
}
origin: google/jimfs

@Override
public GroupPrincipal lookupPrincipalByGroupName(String group) throws IOException {
 if (!supportsGroups) {
  throw new UserPrincipalNotFoundException(group); // required by spec
 }
 return createGroupPrincipal(group);
}
origin: com.google.jimfs/jimfs

@Override
public GroupPrincipal lookupPrincipalByGroupName(String group) throws IOException {
 if (!supportsGroups) {
  throw new UserPrincipalNotFoundException(group); // required by spec
 }
 return createGroupPrincipal(group);
}
origin: de.pfabulist.lindwurm/memoryfs

@Override
public SimplePrincipal lookupPrincipalByName( String name ) throws IOException {
  return users.getOrThrow( name, new UserPrincipalNotFoundException( "no such user: " + name ) );
}
origin: de.pfabulist.lindwurm/memoryfs

@Override
public SimplePrincipal lookupPrincipalByGroupName( String name ) throws IOException {
  return groups.getOrThrow( name, new UserPrincipalNotFoundException( "no such group: " + name ) );
}
origin: com.github.marschall/memoryfilesystem

@Override
public UserPrincipal lookupPrincipalByName(String name) throws IOException {
 this.checker.check();
 String key = this.stringTransformer.transform(name);
 UserPrincipal user = this.users.get(key);
 if (user != null) {
  return user;
 } else {
  throw new UserPrincipalNotFoundException(name);
 }
}
origin: com.github.marschall/memoryfilesystem

@Override
public GroupPrincipal lookupPrincipalByGroupName(String groupName) throws IOException {
 this.checker.check();
 String key = this.stringTransformer.transform(groupName);
 GroupPrincipal group = this.groups.get(key);
 if (group != null) {
  return group;
 } else {
  throw new UserPrincipalNotFoundException(groupName);
 }
}
origin: org.apache.sshd/sshd-sftp

protected UserPrincipal toUser(Path file, UserPrincipal name) throws IOException {
  String username = name.toString();
  FileSystem fileSystem = file.getFileSystem();
  UserPrincipalLookupService lookupService = fileSystem.getUserPrincipalLookupService();
  try {
    if (lookupService == null) {
      throw new UserPrincipalNotFoundException(username);
    }
    return lookupService.lookupPrincipalByName(username);
  } catch (IOException e) {
    handleUserPrincipalLookupServiceException(UserPrincipal.class, username, e);
    return null;
  }
}
origin: org.apache.sshd/sshd-sftp

protected GroupPrincipal toGroup(Path file, GroupPrincipal name) throws IOException {
  String groupName = name.toString();
  FileSystem fileSystem = file.getFileSystem();
  UserPrincipalLookupService lookupService = fileSystem.getUserPrincipalLookupService();
  try {
    if (lookupService == null) {
      throw new UserPrincipalNotFoundException(groupName);
    }
    return lookupService.lookupPrincipalByGroupName(groupName);
  } catch (IOException e) {
    handleUserPrincipalLookupServiceException(GroupPrincipal.class, groupName, e);
    return null;
  }
}
origin: lucastheisen/jsch-nio

@Override
public UserPrincipal lookupPrincipalByName( String user ) throws IOException {
  try {
    if ( getCommandRunner().execute( "id " + user ).getExitCode() == 0 ) {
      return new StandardUserPrincipal( user );
    }
    else {
      throw new UserPrincipalNotFoundException( user + " does not exist" );
    }
  }
  catch ( JSchException e ) {
    throw new IOException( e );
  }
}
origin: lucastheisen/jsch-nio

  @Override
  public GroupPrincipal lookupPrincipalByGroupName( String group ) throws IOException {
    try {
      // I don't like this, but don't have a better way right
      // now...
      // Should be pretty safe in most instances
      if ( getCommandRunner().execute( "egrep -i \"^" + group + "\" /etc/group" ).getExitCode() == 0 ) {
        return new StandardGroupPrincipal( group );
      }
      else {
        throw new UserPrincipalNotFoundException( group + " does not exist" );
      }
    }
    catch ( JSchException e ) {
      throw new IOException( e );
    }
  }
};
java.nio.file.attributeUserPrincipalNotFoundException<init>

Popular methods of UserPrincipalNotFoundException

    Popular in Java

    • Updating database using SQL prepared statement
    • getExternalFilesDir (Context)
    • getSupportFragmentManager (FragmentActivity)
      Return the FragmentManager for interacting with fragments associated with this activity.
    • putExtra (Intent)
    • Kernel (java.awt.image)
    • File (java.io)
      An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
    • Path (java.nio.file)
    • Comparator (java.util)
      A Comparator is used to compare two objects to determine their ordering with respect to each other.
    • Locale (java.util)
      A Locale object represents a specific geographical, political, or cultural region. An operation that
    • Timer (java.util)
      A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now