Rev 1310 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1310 | Rev 1312 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | import jomm.utils.FilesUtils; |
- | |
2 | - | ||
3 | import java.io.File; |
- | |
4 | import java.io.FileInputStream; |
- | |
5 | import java.io.IOException; |
1 | import java.io.IOException; |
6 | 2 | ||
7 | /** |
3 | /** |
8 | * @author Jorge Machado |
4 | * @author Jorge Machado |
9 | * @date 4/Set/2010 |
5 | * @date 4/Set/2010 |
Line 12... | Line 8... | ||
12 | */ |
8 | */ |
13 | public class CopyPhotos { |
9 | public class CopyPhotos { |
14 | 10 | ||
15 | public static void main(1.5.0/docs/api/java/lang/String.html">String [] args) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
11 | public static void main(1.5.0/docs/api/java/lang/String.html">String [] args) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
16 | 12 | ||
17 | args = new 1.5.0/docs/api/java/lang/String.html">String[]{"D:\\Jorge\\Documents\\Fotos\\FotosMae\\102HPIMG"}; |
- | |
18 | 1.5.0/docs/api/java/io/File.html">File dir = new 1.5.0/docs/api/java/io/File.html">File(args[0] + "\\0"); |
- | |
19 | dir.mkdirs(); |
- | |
20 | 1.5.0/docs/api/java/io/File.html">File[] files = new 1.5.0/docs/api/java/io/File.html">File(args[0]).listFiles(); |
- | |
21 | for (int i = 0; i < files.length;i++) |
- | |
22 | { |
13 | |
23 | if(files[i].isFile()) |
- | |
24 | { |
- | |
25 | if(i > 0 && i % 100 == 0) |
- | |
26 | { |
- | |
27 | dir = new 1.5.0/docs/api/java/io/File.html">File( args[0] + "\\" + i); |
- | |
28 | dir.mkdirs(); |
- | |
29 | } |
- | |
30 | FilesUtils.copy(new 1.5.0/docs/api/java/io/FileInputStream.html">FileInputStream(files[i]),dir.getAbsolutePath() + "\\" + files[i].getName()); |
- | |
31 | } |
- | |
32 | } |
- | |
33 | 14 | ||
34 | } |
15 | } |
35 | } |
16 | } |