All pastes #1320657 Raw Edit

Meins

public java v1 · immutable
#1320657 ·published 2009-01-28 15:06 UTC
rendered paste body
import java.io.*;public class Test{   public static void main (String args[])    {   // get the file.txt file        File file=new File("file.txt");        if (file.exists() && !file.isDirectory())        {   System.out.println("Datei "+file.getName()+" gefunden");            System.out.println("Voller Name: "+file.getAbsolutePath());        }                // get all text files        File dir=new File(".");        String[] list=dir.list();        for (int i=0; i<list.length; i++)            if (list[i].endsWith(".txt"))            {   long length=new File(dir,list[i]).length(); // get length                System.out.println(list[i]+" ["+length+"]");            }            }}