The output of the following method is:
C: \ Users \ User \ Desktop \ files \ filename.jpg
How can I get only the filename.jpg
in String format? I tried to use FileUtils
but as an output I got this:
.ELs / G Yos e ([ E v ^ C O W ݭ : Zj 2 + յ v [{ J
public static void getImgs(String path){
File file = new File(path);
File[] arquivos = file.listFiles();
try {
for (File arquivo : arquivos) {
System.out.println(arquivo);
}
}catch (Exception e){
e.printStackTrace();
}
}