Java Code Examples for java.nio.file.Path#getClass()

The following examples show how to use java.nio.file.Path#getClass() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: mycore   File: MCRPath.java    License: GNU General Public License v3.0 5 votes vote down vote up
public static MCRPath toMCRPath(final Path other) {
    if (other == null) {
        throw new NullPointerException();
    }
    if (!(other instanceof MCRPath)) {
        throw new ProviderMismatchException("other is not an instance of MCRPath: " + other.getClass());
    }
    return (MCRPath) other;
}
 
Example 2
Source Project: lucene-solr   File: FilterPath.java    License: Apache License 2.0 5 votes vote down vote up
/** Override this to customize the unboxing of Path
 *  from various operations
 */
protected Path toDelegate(Path path) {
  if (path instanceof FilterPath) {
    FilterPath fp = (FilterPath) path;
    if (fp.fileSystem != fileSystem) {
      throw new ProviderMismatchException("mismatch, expected: " + fileSystem.provider().getClass() + ", got: " + fp.fileSystem.provider().getClass());
    }
    return fp.delegate;
  } else {
    throw new ProviderMismatchException("mismatch, expected: FilterPath, got: " + path.getClass());
  }
}
 
Example 3
protected Path toDelegate(Path path) {
  if (path instanceof FilterPath) {
    FilterPath fp = (FilterPath) path;
    if (fp.fileSystem != fileSystem) {
      throw new ProviderMismatchException("mismatch, expected: " + fileSystem.provider().getClass() + ", got: " + fp.fileSystem.provider().getClass());
    }
    return fp.delegate;
  } else {
    throw new ProviderMismatchException("mismatch, expected: FilterPath, got: " + path.getClass());
  }
}
 
Example 4
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}
 
Example 5
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}
 
Example 6
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}
 
Example 7
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}
 
Example 8
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}
 
Example 9
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}
 
Example 10
protected PathFileObject(JavacPathFileManager fileManager, Path path) {
    fileManager.getClass(); // null check
    path.getClass();        // null check
    this.fileManager = fileManager;
    this.path = path;
}