hy ,
i would like backup a index.
1) my first idea is to make a system copy of all the files
but in the FSDirectory class, there is no public method to know where is located the
directory. A simple methode like
public File getDirectoryFile() {
return directory; would be great;
}
2) so i decide to create a copy(Directory source, Directory target) method
i seen the openFile() and createFile method but after i
but i don't know how use it (see my function , this function make a Exception )
private void copy (Directory source, Directory target) throws IOException {
String[] files=source.list();
for(int i=0; i<files.length; i++) {
InputStream in=source.openFile(files[i]);
OutputStream out=target.createFile(files[i]);
byte c;
while((c=in.readByte())!=-1) {
out.writeByte(c);
}
in.close();
out.close();
}
someone could help me please
nico