Examples of NoSuchFileException


Examples of java.nio.file.NoSuchFileException

  @Override
  public IndexInputSlicer createSlicer(final String name, IOContext context)
      throws IOException {
    maybeYield();
    if (!LuceneTestCase.slowFileExists(in, name)) {
      throw randomState.nextBoolean() ? new FileNotFoundException(name) : new NoSuchFileException(name);
    }
    // cannot open a file for input if it's still open for
    // output, except for segments.gen and segments_N
    if (openFilesForWrite.contains(name) && !name.startsWith("segments")) {
      throw (IOException) fillOpenTrace(new IOException("MockDirectoryWrapper: file \"" + name + "\" is still open for writing"), name, false);
View Full Code Here

Examples of java.nio.file.NoSuchFileException

    }

    if (options.contains(CREATE) || options.contains(CREATE_NEW)) {
      return getOrCreateRegularFileWithWriteLock(path, options, attrs);
    } else {
      throw new NoSuchFileException(path.toString());
    }
  }
View Full Code Here

Examples of java.nio.file.NoSuchFileException

    checkNotNull(options);

    DirectoryEntry result = lookUp(workingDirectory, path, options, 0);
    if (result == null) {
      // an intermediate file in the path did not exist or was not a directory
      throw new NoSuchFileException(path.toString());
    }
    return result;
  }
View Full Code Here

Examples of java.nio.file.NoSuchFileException

   * @return this
   * @throws NoSuchFileException if this entry does not exist
   */
  public DirectoryEntry requireExists(Path pathForException) throws NoSuchFileException {
    if (!exists()) {
      throw new NoSuchFileException(pathForException.toString());
    }
    return this;
  }
View Full Code Here

Examples of java.nio.file.NoSuchFileException

        if (recipient == null) {
            throw new IllegalArgumentException("jid must not be null.");
        }

        if (!file.exists()) {
            throw new IllegalArgumentException(new NoSuchFileException(file.getName()));
        }

        // Before a Stream Initiation is attempted the Sender should be sure that the Receiver supports both Stream Initiation and the specific profile that they wish to use.
        if (entityCapabilitiesManager.isSupported(StreamInitiation.NAMESPACE, recipient) && entityCapabilitiesManager.isSupported(SIFileTransferOffer.NAMESPACE, recipient)) {
View Full Code Here

Examples of java.nio.file.NoSuchFileException

    public PathContentProvider(String contentType, Path filePath, int bufferSize) throws IOException
    {
        super(contentType);
        if (!Files.isRegularFile(filePath))
            throw new NoSuchFileException(filePath.toString());
        if (!Files.isReadable(filePath))
            throw new AccessDeniedException(filePath.toString());
        this.filePath = filePath;
        this.fileSize = Files.size(filePath);
        this.bufferSize = bufferSize;
View Full Code Here

Examples of java.nio.file.NoSuchFileException

    }

    public PathContentProvider(Path filePath, int bufferSize) throws IOException
    {
        if (!Files.isRegularFile(filePath))
            throw new NoSuchFileException(filePath.toString());
        if (!Files.isReadable(filePath))
            throw new AccessDeniedException(filePath.toString());
        this.filePath = filePath;
        this.fileSize = Files.size(filePath);
        this.bufferSize = bufferSize;
View Full Code Here

Examples of org.jboss.fresh.vfs.NoSuchFileException

    // tricky one - if both are inside the same mount, then delegate,
    // otherwise do the move ourselves

    MountData dat = findFS(oldName);
    if(dat == null)
      throw new NoSuchFileException(String.valueOf(oldName));

    MountData dat2 = findFS(newName);
    if(dat2 == null) {
      throw new NoSuchFileException(String.valueOf(newName.getPath()));
    }

    if(dat == dat2) {
      dat.vfs.move(ctx, translate(dat, oldName), translate(dat, newName), direct);
    } else {
View Full Code Here

Examples of org.jboss.fresh.vfs.NoSuchFileException

//        filepath = vfs.resolve(shell.getUserCtx(), filepath, true);
        if (vfs.exists(shell.getUserCtx(), filepath, true)) {
          paths.add(filepath);
        } else {
          if (canThrowEx()) {
            throw new NoSuchFileException("Path does not exist: " + filepath);
          } else {
            out.println("Path does not exist: " + filepath);
          }
        }
      }
View Full Code Here

Examples of org.uberfire.java.nio.file.NoSuchFileException

                                       final OpenOption... options )
            throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException {
        checkNotNull( "path", path );
        final File file = path.toFile();
        if ( !file.exists() ) {
            throw new NoSuchFileException( file.toString() );
        }
        try {
            return new FileInputStream( path.toFile() );
        } catch ( FileNotFoundException e ) {
            throw new NoSuchFileException( e.getMessage() );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.