- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Dictionary d =
new Hashtable()
Bundle bundle;bundle.getHeaders()
new Properties()
- Smart code suggestions by Codota
}
/** * @param f * 文件对象 * @return 文件或者目录名 */ public static String getName(File f) { return getName(f.getPath()); }
/** * @param f * 文件对象 * @return 文件或者目录名 */ public static String getName(File f) { return getName(f.getPath()); }
public class FileCopy { public static void main(String[] args) { File folder= new File("Tango"); File[] files = folder.listFiles(); for (Files file : files ) { String filename = file.getName().substring(0,file.getName().indexOf(".")); File yourDir= new File(filename); if (!yourDir.exists()) { yourDir.mkDir(); } file.renameTo(new File(yourDir.getAbsolutePath() + file.getName())); } } }