Indented file.
This commit is contained in:
parent
3cbfdd545b
commit
b695464c2c
1 changed files with 65 additions and 65 deletions
|
@ -30,82 +30,82 @@ import fr.devinsy.util.FileIterator;
|
||||||
*/
|
*/
|
||||||
public class FileIteratorSandbox
|
public class FileIteratorSandbox
|
||||||
{
|
{
|
||||||
static private final Logger logger;
|
private static final Logger logger;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
// Initialize logger.
|
// Initialize logger.
|
||||||
org.apache.log4j.BasicConfigurator.configure();
|
org.apache.log4j.BasicConfigurator.configure();
|
||||||
org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.DEBUG);
|
org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.DEBUG);
|
||||||
|
|
||||||
logger = LoggerFactory.getLogger(CmdExecSandbox.class);
|
logger = LoggerFactory.getLogger(FileIteratorSandbox.class);
|
||||||
|
|
||||||
//
|
//
|
||||||
org.apache.log4j.Logger defaultLogger = org.apache.log4j.Logger.getRootLogger();
|
org.apache.log4j.Logger defaultLogger = org.apache.log4j.Logger.getRootLogger();
|
||||||
defaultLogger.removeAllAppenders();
|
defaultLogger.removeAllAppenders();
|
||||||
defaultLogger.addAppender(new ConsoleAppender(new PatternLayout("%d{ISO8601} - dutils [%-5p] %34.34c.%-25M - %m%n")));
|
defaultLogger.addAppender(new ConsoleAppender(new PatternLayout("%d{ISO8601} - dutils [%-5p] %34.34c.%-25M - %m%n")));
|
||||||
|
|
||||||
//
|
//
|
||||||
logger.debug("Log initialized.");
|
logger.debug("Log initialized.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static void main(final String[] args)
|
public static void main(final String[] args)
|
||||||
{
|
{
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected static void test()
|
protected static void test()
|
||||||
{
|
{
|
||||||
System.out.println("user.dir=" + System.getProperty("user.dir"));
|
System.out.println("user.dir=" + System.getProperty("user.dir"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// File f = new File("TestTree/DirectoryOne/titi2");
|
// File f = new File("TestTree/DirectoryOne/titi2");
|
||||||
// File f = new File("/home/cpm/.kde//cache-cpmstar");
|
// File f = new File("/home/cpm/.kde//cache-cpmstar");
|
||||||
File f = new File("tests/TestTree/xine.jpg");
|
File f = new File("tests/TestTree/xine.jpg");
|
||||||
System.out.println("exists=" + f.exists());
|
System.out.println("exists=" + f.exists());
|
||||||
System.out.println("canonical path = " + f.getCanonicalPath());
|
System.out.println("canonical path = " + f.getCanonicalPath());
|
||||||
System.out.println("absolute path = " + f.getAbsolutePath());
|
System.out.println("absolute path = " + f.getAbsolutePath());
|
||||||
System.out.println("name = " + f.getName());
|
System.out.println("name = " + f.getName());
|
||||||
System.out.println("parent = " + f.getParent());
|
System.out.println("parent = " + f.getParent());
|
||||||
System.out.println("path = " + f.getPath());
|
System.out.println("path = " + f.getPath());
|
||||||
System.out.println("path = " + f.lastModified());
|
System.out.println("path = " + f.lastModified());
|
||||||
System.out.println("path = " + f.length());
|
System.out.println("path = " + f.length());
|
||||||
System.out.println("path = " + f.isFile());
|
System.out.println("path = " + f.isFile());
|
||||||
System.out.println("path = " + f.isDirectory());
|
System.out.println("path = " + f.isDirectory());
|
||||||
System.out.println("list = " + f.list());
|
System.out.println("list = " + f.list());
|
||||||
|
|
||||||
System.out.println("----");
|
System.out.println("----");
|
||||||
// FileIterator i = new FileIterator(new File("tests/TestTree"));
|
// FileIterator i = new FileIterator(new File("tests/TestTree"));
|
||||||
FileIterator i = new FileIterator(new File("tests/TestTree/xine.jpg"), null, true);
|
FileIterator i = new FileIterator(new File("tests/TestTree/xine.jpg"), null, true);
|
||||||
// FileIterator i = new FileIterator(new
|
// FileIterator i = new FileIterator(new
|
||||||
// File("/home/cpm/.kde/cache-cpmstar"), ".*cache.*", false);
|
// File("/home/cpm/.kde/cache-cpmstar"), ".*cache.*", false);
|
||||||
// FileIterator i = new FileIterator(new File("tests/TestTree"),
|
// FileIterator i = new FileIterator(new File("tests/TestTree"),
|
||||||
// ".*dsc.*", false);
|
// ".*dsc.*", false);
|
||||||
// FileIterator i = new FileIterator(new
|
// FileIterator i = new FileIterator(new
|
||||||
// File("/home/cpm/Images/Photos/"));
|
// File("/home/cpm/Images/Photos/"));
|
||||||
// FileIterator i = new FileIterator(new
|
// FileIterator i = new FileIterator(new
|
||||||
// File("/home/cpm/Images/Photos/"), ".*\\.(JPG|jpg)", false);
|
// File("/home/cpm/Images/Photos/"), ".*\\.(JPG|jpg)", false);
|
||||||
// FileIterator i = new FileIterator(new
|
// FileIterator i = new FileIterator(new
|
||||||
// File("/home/cpm/Images/Photos/"), ".*anni_moi.*", false);
|
// File("/home/cpm/Images/Photos/"), ".*anni_moi.*", false);
|
||||||
|
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
// System.out.println(i.toString());
|
// System.out.println(i.toString());
|
||||||
System.out.println("File=[" + i.next().getPath() + "]");
|
System.out.println("File=[" + i.next().getPath() + "]");
|
||||||
}
|
}
|
||||||
i.reset();
|
i.reset();
|
||||||
System.out.println("Cardinal=" + i.finalCountdown());
|
System.out.println("Cardinal=" + i.finalCountdown());
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
System.out.println("ERROR:" + exception.getMessage());
|
System.out.println("ERROR:" + exception.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue