Revision 11332 trunk/libraries/libRaster/src/org/gvsig/raster/dataset/io/rmf/RmfBlocksManager.java
RmfBlocksManager.java | ||
---|---|---|
18 | 18 |
*/ |
19 | 19 |
package org.gvsig.raster.dataset.io.rmf; |
20 | 20 |
|
21 |
import java.io.File; |
|
22 |
|
|
21 | 23 |
/** |
22 | 24 |
* Gestor para la escritura de bloques XML en el fichero RMF. Cada cliente que quiere |
23 | 25 |
* escribir en el se registrar? a traves de ClientRegister y esta clase ser? la encargada |
... | ... | |
26 | 28 |
* 21-abr-2007 |
27 | 29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
28 | 30 |
*/ |
29 |
public class RmfBlocksManager extends ClientRegister implements IRmfBlock{ |
|
31 |
public class RmfBlocksManager extends ClientRegister implements IRmfBlock { |
|
32 |
|
|
33 |
public static final String MAIN_TAG = "RasterMetaFile"; |
|
34 |
|
|
35 |
private String path = null; |
|
36 |
|
|
37 |
/** |
|
38 |
* Constructor. Asigna la ruta del fichero. |
|
39 |
* @param path |
|
40 |
*/ |
|
41 |
public RmfBlocksManager(String path) { |
|
42 |
this.path = path; |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* Asigna la ruta del fichero |
|
47 |
* @param path |
|
48 |
*/ |
|
30 | 49 |
public void setPath(String path) { |
31 |
|
|
50 |
this.path = path; |
|
32 | 51 |
} |
33 | 52 |
|
34 |
|
|
53 |
/* |
|
54 |
* (non-Javadoc) |
|
55 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#read(java.lang.String) |
|
56 |
*/ |
|
35 | 57 |
public void read(String xml) { |
58 |
|
|
36 | 59 |
} |
37 | 60 |
|
38 |
|
|
61 |
/* |
|
62 |
* (non-Javadoc) |
|
63 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#write() |
|
64 |
*/ |
|
39 | 65 |
public String write() { |
66 |
File file = new File(path); |
|
67 |
if(!file.exists()) |
|
68 |
return null; |
|
69 |
|
|
70 |
for (int i = 0; i < clients.size(); i++) { |
|
71 |
IRmfBlock block = ((IRmfBlock)clients.get(i)); |
|
72 |
String tag = block.getMainTag(); |
|
73 |
|
|
74 |
String s = ((IRmfBlock)clients.get(i)).write(); |
|
75 |
|
|
76 |
} |
|
40 | 77 |
return null; |
41 | 78 |
} |
79 |
|
|
80 |
/* |
|
81 |
* (non-Javadoc) |
|
82 |
* @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getMainTag() |
|
83 |
*/ |
|
84 |
public String getMainTag() { |
|
85 |
return MAIN_TAG; |
|
86 |
} |
|
42 | 87 |
} |
Also available in: Unified diff