Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void veureinfo(String filePath) throws FileNotFoundException{
- File origen = new File(filePath);
- if (origen.isFile()){
- System.out.println("Java VeureInfo " +origen.getAbsolutePath());
- System.out.println("INFORMACIÓ: Informació sobre el fitxer:");
- System.out.println("Nom del fitxer : "+origen.getName());
- System.out.println("Ruta : "+origen.getPath());
- System.out.println("Ruta Absoluta : "+origen.getAbsolutePath());
- System.out.println("Es pot escriure : "+origen.canWrite());
- System.out.println("Es pot lleguir : "+origen.canRead());
- System.out.println("Grandaria : "+origen.length()+(" bytes"));
- }else{
- System.out.println("directorio") ;
- }
- }
- public static void main(String args[]) {
- try {
- veureinfo(args[0]);
- } catch (FileNotFoundException error) {
- System.out.println(error);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement