Saturday, 16 June 2012

Scan folder pgm


Scan folder pgm

package com.demo;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.commons.io.FileUtils;

public class ScanFolder {

private static List<File> filelist = new ArrayList<File>();

public static void main(String[] args) {

File root = new File("c:/javasamples");
while (true) {
Collection<File> files = FileUtils.listFiles(root,
new String[] {".vob"}, true);
//System.out.println("filelist");
for (File fileslist : files)
{
System.out.println("controal reached");
System.out.println("controal reached fileslist"+fileslist);

if (!filelist.contains(fileslist))
{
System.out.println("controal reached if block");
filelist.add(fileslist);
System.out.println("file added "+fileslist.getName());
}
}
}

}

}


No comments:

Post a Comment

Pass a HashMap from Angular Client to Spring boot API

This example is for the case where fileData is very huge and in json format   let map = new Map<string, string>()      map.set(this.ge...