Explorar el Código

add FileUtil.replaceExt

master
Jonathan Cobb hace 4 años
padre
commit
bcd403f6fd
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. +5
    -0
      src/main/java/org/cobbzilla/util/io/FileUtil.java

+ 5
- 0
src/main/java/org/cobbzilla/util/io/FileUtil.java Ver fichero

@@ -624,4 +624,9 @@ public class FileUtil {
return found.get();
}

public static String replaceExt(String path, String ext) {
final int pos = path.lastIndexOf('.');
return pos == -1 ? path + "." + ext : path.substring(0, pos) + ext;
}

}

Cargando…
Cancelar
Guardar