Java Path Create nio createPath(String fileName, String subfolder)

Here you can find the source of createPath(String fileName, String subfolder)

Description

create Path

License

Open Source License

Declaration

private static Path createPath(String fileName, String subfolder) 

Method Source Code

//package com.java2s;
/* FileHelper.java/*from  ww w.  j a  v  a  2  s .  c om*/
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Copyright ? 2014-2015 Universiteit Gent
 * 
 * This file is part of the Degage Web Application
 * 
 * Corresponding author (see also AUTHORS.txt)
 * 
 * Kris Coolsaet
 * Department of Applied Mathematics, Computer Science and Statistics
 * Ghent University 
 * Krijgslaan 281-S9
 * B-9000 GENT Belgium
 * 
 * The Degage Web Application is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * The Degage Web Application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with the Degage Web Application (file LICENSE.txt in the
 * distribution).  If not, see http://www.gnu.org/licenses/.
 */

import java.nio.file.Path;
import java.nio.file.Paths;

import java.util.UUID;

public class Main {
    private static Path createPath(String fileName, String subfolder) {
        return Paths.get(subfolder, UUID.randomUUID() + "-" + fileName.replace("/", "-").replace("\\", "-"));
    }
}

Related

  1. createJSONFileIfNotExists(Path path)
  2. createLanguageStructure(final String lang, final Path docRootFolder)
  3. createList(Iterable dirs)
  4. createMainClassAndBuildFileWithDeps(String targetName, String deps, Path dir)
  5. createOverwriteDirectory(Path path)
  6. createPathComparator()
  7. createPathMatcher(String[] patterns)
  8. createPathOrNull(String pathString)
  9. createPathRelativizer(Path path, boolean doRelativize)