comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/FileTools.java @ 452:b79a3598818c

FĂ­leTools#removeExtension: Moved from PRFParser.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 28 Dec 2012 13:32:23 +0100
parents e39e23320a23
children a2efc9d65a11
comparison
equal deleted inserted replaced
451:e79ad624f94c 452:b79a3598818c
39 39
40 public static final String DIGEST = 40 public static final String DIGEST =
41 System.getProperty("artifacts.common.file.cmp.digest", "MD5"); 41 System.getProperty("artifacts.common.file.cmp.digest", "MD5");
42 42
43 private FileTools() { 43 private FileTools() {
44 }
45
46
47 /** Remove everything after dot from name. */
48 public static final String removeExtension(String name) {
49 int index = name.lastIndexOf('.');
50 return index == -1
51 ? name
52 : name.substring(0, index);
44 } 53 }
45 54
46 55
47 public static File getDirectory(String path, String name) { 56 public static File getDirectory(String path, String name) {
48 if (path == null || name == null) { 57 if (path == null || name == null) {

http://dive4elements.wald.intevation.org