Revision 10874 branches/v10/extensions/extPublish/src/org/gvsig/remoteservices/conf/geonetwork/test/DDF2postgres.java
DDF2postgres.java | ||
---|---|---|
1 | 1 |
|
2 | 2 |
package org.gvsig.remoteservices.conf.geonetwork.test; |
3 | 3 |
|
4 |
import java.io.BufferedReader; |
|
4 | 5 |
import java.io.DataInputStream; |
5 | 6 |
import java.io.File; |
6 | 7 |
import java.io.FileInputStream; |
7 | 8 |
import java.io.FileNotFoundException; |
8 | 9 |
import java.io.FileWriter; |
9 | 10 |
import java.io.IOException; |
11 |
import java.io.InputStream; |
|
12 |
import java.io.InputStreamReader; |
|
10 | 13 |
import java.util.Vector; |
11 | 14 |
|
12 | 15 |
|
... | ... | |
15 | 18 |
File f=null; |
16 | 19 |
File sql=null; |
17 | 20 |
File f2=null; |
18 |
DataInputStream read = null; |
|
19 | 21 |
FileWriter write = null; |
20 | 22 |
File aux[]=null; |
21 | 23 |
String path=null; |
22 | 24 |
String squema="public"; |
25 |
BufferedReader read= null; |
|
23 | 26 |
|
24 | 27 |
//squema --> squema of the ddf files (must belong same squema) |
25 | 28 |
//path -->path to the ddf files |
... | ... | |
45 | 48 |
} |
46 | 49 |
|
47 | 50 |
//conver all ddf files in path to .sql format |
48 |
//all .sql files are created into path/sql subdir (if exist will be deleted) |
|
51 |
//all .sql files are created into path/sql subdir (if exist will be deleted, be carefull my friend)
|
|
49 | 52 |
public void convert(){ |
50 | 53 |
int i; |
51 | 54 |
for(i=0;i<aux.length;i++){ |
... | ... | |
59 | 62 |
//System.out.println(table); |
60 | 63 |
//System.out.println(sql.getName()); |
61 | 64 |
try{ |
62 |
read = new DataInputStream(new FileInputStream(aux[i]));
|
|
65 |
read = new BufferedReader(new InputStreamReader(new DataInputStream(new FileInputStream(aux[i]))));
|
|
63 | 66 |
write = new FileWriter(sql); |
64 | 67 |
String s=read.readLine(); |
65 | 68 |
String s2[]=null; |
Also available in: Unified diff