Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. public static void veureinfo(String filePath) throws FileNotFoundException{
  2.  
  3. File origen = new File(filePath);
  4.  
  5.  
  6. if (origen.isFile()){
  7. System.out.println("Java VeureInfo " +origen.getAbsolutePath());
  8. System.out.println("INFORMACIÓ: Informació sobre el fitxer:");
  9. System.out.println("Nom del fitxer : "+origen.getName());
  10. System.out.println("Ruta : "+origen.getPath());
  11. System.out.println("Ruta Absoluta : "+origen.getAbsolutePath());
  12. System.out.println("Es pot escriure : "+origen.canWrite());
  13. System.out.println("Es pot lleguir : "+origen.canRead());
  14. System.out.println("Grandaria : "+origen.length()+(" bytes"));
  15.  
  16. }else{
  17.  
  18. System.out.println("directorio") ;
  19. }
  20.  
  21. }
  22.  
  23.  
  24. public static void main(String args[]) {
  25.  
  26.  
  27. try {
  28. veureinfo(args[0]);
  29. } catch (FileNotFoundException error) {
  30. System.out.println(error);
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement