Here you can find the source of isUNC(Path inputPath)
Parameter | Description |
---|---|
inputPath | the path to check |
synchronized public static boolean isUNC(Path inputPath)
//package com.java2s; /*/* w w w . jav a 2s . com*/ * Autopsy Forensic Browser * * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier <at> sleuthkit <dot> org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.nio.file.Path; public class Main { private static final String UNC_PATH_START = "\\\\"; /** * Test if a Path is UNC. It is considered UNC if it begins with \\ * * @param inputPath the path to check * * @return true if the passed in Path is UNC, false otherwise */ synchronized public static boolean isUNC(Path inputPath) { if (inputPath != null) { return isUNC(inputPath.toString()); } else { return false; } } /** * Test if a String path is UNC. It is considered UNC if it begins with \\ * * @param inputPath the String of the path to check * * @return true if the passed in Path is UNC, false otherwise */ synchronized public static boolean isUNC(String inputPath) { if (inputPath != null) { return inputPath.startsWith(UNC_PATH_START); } else { return false; } } }