Saturday, 16 June 2012

without extension file names


without extension file names

package com.demo;

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

public class SampleFile {

public static void main(String[] args) {
File f1 = new File("c:/javasamples");
File[] filelist = f1.listFiles();

for(File list : filelist)
{
//System.out.println("array is "+list.getName().substring(0, list.getName().lastIndexOf('.')));
System.out.println("ar is "+list.getName().substring(0, list.getName().lastIndexOf('.')));
}


}

}

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...