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

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -