Here you can find the source of cleanPath(String path)
Parameter | Description |
---|---|
path | the path to which the file separator should be added if necessary |
public static String cleanPath(String path)
//package com.java2s; /*/* ww w . ja va 2 s . c om*/ * This file is part of "Tweety", a collection of Java libraries for * logical aspects of artificial intelligence and knowledge representation. * * Tweety is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Make sure the file separator is at the end of a given path. * @param path the path to which the file separator should be added if necessary * @return the path ending with a file separator */ public static String cleanPath(String path) { if (!path.endsWith(System.getProperty("file.separator"))) { path = path.concat(System.getProperty("file.separator")); } return path; } }