Here you can find the source of getPath(String outputDir, String qualifiedFilename, String fileextension)
public static Path getPath(String outputDir, String qualifiedFilename, String fileextension)
//package com.java2s; /*//from www. j a v a2s .c o m * ****************************************************************************** * MontiCore Language Workbench * Copyright (c) 2015, MontiCore, All rights reserved. * * This project is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this project. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************** */ import java.nio.file.FileSystems; import java.nio.file.Path; public class Main { public static Path getPath(String outputDir, String qualifiedFilename, String fileextension) { String[] pathParts = qualifiedFilename.split("\\."); pathParts[pathParts.length - 1] = pathParts[pathParts.length - 1] + "." + fileextension; return FileSystems.getDefault().getPath(outputDir, pathParts); } /** * @param qn QualifiedName (without fileExtesion) or FullQualifiedName (with fileExtesion) * @return */ public static String getPath(String qn) { String path = ""; if (qn.contains(".")) { path = qn.substring(0, qn.lastIndexOf(".")); } return path; } }