| @ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <classpath> | |||||
| <classpathentry kind="src" path="src"/> | |||||
| <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | |||||
| <classpathentry kind="output" path="bin"/> | |||||
| </classpath> | |||||
| @ -0,0 +1,17 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <projectDescription> | |||||
| <name>Tree</name> | |||||
| <comment></comment> | |||||
| <projects> | |||||
| </projects> | |||||
| <buildSpec> | |||||
| <buildCommand> | |||||
| <name>org.eclipse.jdt.core.javabuilder</name> | |||||
| <arguments> | |||||
| </arguments> | |||||
| </buildCommand> | |||||
| </buildSpec> | |||||
| <natures> | |||||
| <nature>org.eclipse.jdt.core.javanature</nature> | |||||
| </natures> | |||||
| </projectDescription> | |||||
| @ -1,2 +1,23 @@ | |||||
| # Tree | # Tree | ||||
| ## Usage | |||||
| Hay que pasar la ruta del directorio y la extensión en los argumentos al ejecutarlo. | |||||
| Buscara los archivos que tengan esa extension en todas las carpetas del directorio. | |||||
| ``` | |||||
| |PMDM | |||||
| |_prac_instalació_android_studio.pdf | |||||
| |_Presentació_programació_multimedia_i_dispositius_mòbils.pdf | |||||
| |_Presentació_Tutoria.pdf | |||||
| |_T1 | |||||
| |__Nueva carpeta | |||||
| |__prac_autoevaluació.pdf | |||||
| |__Tema01_Tecnologies_per_al_desenvolupament_daplicacions_mòbils.pdf | |||||
| |_T2 | |||||
| |__Tema02_Arquitectura_i_estructura_duna_aplicació_Android.pdf | |||||
| |_T3 | |||||
| |__butlleti_exercicis.pdf | |||||
| |__Tema03_Interfícies_dusuari_Layouts_i_controls_bàsics.pdf | |||||
| |_T4 | |||||
| |__exercici_spinner_llista_països.pdf | |||||
| |__Tema04_Interfícies_dusuari_Controls_de_selecció.pdf | |||||
| ``` | |||||
| @ -0,0 +1,31 @@ | |||||
| package es.antoniotgit; | |||||
| import java.io.File; | |||||
| import java.io.IOException; | |||||
| public class TreeComand { | |||||
| public static void printFile(File f, String spaces, String extension) { | |||||
| System.out.println(spaces.concat(/*File.separator*/"").concat(f.getName())); | |||||
| if (f.isDirectory() && f.canRead()) { | |||||
| for (File file : f.listFiles()) { | |||||
| if(file.isDirectory() || file.getName().endsWith(extension)) | |||||
| printFile(file, spaces.concat("_"),extension); | |||||
| } | |||||
| } | |||||
| } | |||||
| public static void main(String[] args) throws IOException{ | |||||
| if(args.length > 2) { | |||||
| System.out.println("ERROR solo 2 argumentos"); | |||||
| System.exit(1); | |||||
| } | |||||
| String path = args[0]; | |||||
| String extension = args[1]; | |||||
| printFile(new File(path), "|", extension); | |||||
| //"C:\\Users\\Anto.LAPTOP-CR44LNOV\\Desktop\\PMDM" | |||||
| } | |||||
| } | |||||