Revision 5988 org.gvsig.raster.multifile/trunk/org.gvsig.raster.multifile/org.gvsig.raster.multifile.io/src/main/java/org/gvsig/raster/multifile/io/MultiFileFormat.java
MultiFileFormat.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
/** |
29 | 29 |
* MultiFileFormat information |
30 |
*
|
|
30 |
* |
|
31 | 31 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
32 | 32 |
*/ |
33 | 33 |
public class MultiFileFormat { |
... | ... | |
36 | 36 |
|
37 | 37 |
/** |
38 | 38 |
* Gets the name of this serial |
39 |
* @return |
|
39 |
* @return String
|
|
40 | 40 |
*/ |
41 | 41 |
public String getName() { |
42 | 42 |
return name; |
43 | 43 |
} |
44 |
|
|
44 |
|
|
45 | 45 |
/** |
46 | 46 |
* Sets the name of this serie |
47 | 47 |
* @param name |
... | ... | |
52 | 52 |
|
53 | 53 |
/** |
54 | 54 |
* Gets the number of files of this serial |
55 |
* @return |
|
55 |
* @return int
|
|
56 | 56 |
*/ |
57 | 57 |
public int getNumberOfFiles() { |
58 | 58 |
return fileList.size(); |
59 | 59 |
} |
60 |
|
|
60 |
|
|
61 | 61 |
/** |
62 | 62 |
* Gets the path of the file in the selected position |
63 | 63 |
* @param file |
64 |
* @return |
|
64 |
* @return String
|
|
65 | 65 |
*/ |
66 | 66 |
public String getPathToFile(int file) { |
67 | 67 |
return fileList.get(file).getAbsolutePath(); |
68 | 68 |
} |
69 |
|
|
69 |
|
|
70 | 70 |
/** |
71 | 71 |
* Adds a file to the list |
72 | 72 |
* @param file |
... | ... | |
74 | 74 |
public void addFile(File file) { |
75 | 75 |
fileList.add(file); |
76 | 76 |
} |
77 |
|
|
77 |
|
|
78 | 78 |
/** |
79 |
* Cleans the list of files
|
|
79 |
* Cleans the list of files |
|
80 | 80 |
*/ |
81 | 81 |
public void clean() { |
82 | 82 |
fileList.clear(); |
83 | 83 |
name = null; |
84 | 84 |
} |
85 |
|
|
85 |
|
|
86 |
/** |
|
87 |
* @param fileName |
|
88 |
* @param path |
|
89 |
* @param uriList |
|
90 |
* @return String |
|
91 |
* @throws IOException |
|
92 |
*/ |
|
86 | 93 |
public static String saveMultiFileFormat(String fileName, String path, ArrayList<File> uriList) throws IOException { |
87 | 94 |
path = path + File.separator + fileName + ".mff"; |
88 |
|
|
95 |
|
|
89 | 96 |
MultiFileFormat format = new MultiFileFormat(); |
90 | 97 |
for (int i = 0; i < uriList.size(); i++) { |
91 | 98 |
format.addFile(uriList.get(i)); |
92 | 99 |
} |
93 | 100 |
format.setName(fileName); |
94 |
|
|
101 |
|
|
95 | 102 |
format.write(path); |
96 | 103 |
return path; |
97 | 104 |
} |
98 |
|
|
105 |
|
|
99 | 106 |
/** |
100 | 107 |
* Writes a MultiFileFormat to disk |
108 |
* @param fileName |
|
101 | 109 |
* @param file |
102 | 110 |
* @throws IOException |
103 | 111 |
*/ |
Also available in: Unified diff