Java Path Exist nio exist(Path... paths)

Here you can find the source of exist(Path... paths)

Description

Helper method to check Path existence.

License

MIT License

Parameter

Parameter Description
paths a parameter

Declaration

protected static boolean exist(Path... paths) 

Method Source Code

//package com.java2s;
/*/*  w  w  w  .j a v  a 2  s.  c o m*/
 * Copyright (C) 2017 Nameless Production Committee
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *          https://opensource.org/licenses/MIT
 */

import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    /**
     * <p>
     * Helper method to check {@link Path} existence.
     * </p>
     * 
     * @param paths
     * @return
     */
    protected static boolean exist(Path... paths) {
        for (Path path : paths) {
            assert Files.exists(path);
        }
        return true;
    }
}

Related

  1. checkFileExists(Path path, LinkOption... options)
  2. checkFileExists(String path)
  3. checkPathExistence(String path)
  4. directoryExist(String path)
  5. ensureDirectoryExists(final Path fileLocation)
  6. exists(Path file)
  7. exists(Path path)
  8. exists(Path path, LinkOption... options)
  9. exists(Path value)