java - File isDirectory() method always returns false when folder name contains special chars -
i false return isdirectory() method when folder name contains specials chars ó or ñ.
the java code works fine in dos, have problem executing jar in nas (linux).
public static void listardirectorio(file f, string separador) throws exception { file[] ficheros = f.listfiles(); file ficherotratado = null; (int x = 0; x < ficheros.length; x++) { ficherotratado = null; ficherotratado = ficheros[x].getcanonicalfile(); if (!ficherotratado.isdirectory()) { system.out.println( "checking file: " + ficherotratado.getname()); if (esborrable(ficherotratado.getname())) { system.out.println( "file can erased: " + ficherotratado.getname()); } }else if (!ficheros[x].getname().startswith("@")) { string nuevo_separador; nuevo_separador = separador + " # "; listardirectorio(ficheros[x], nuevo_separador); } } }
Comments
Post a Comment