Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / importer / doc / ODTMovePicturesFiles.groovy @ 966

History | View | Annotate | Download (453 Bytes)

1 321 mdecorde
package org.txm.importer.doc
2 321 mdecorde
3 321 mdecorde
File dir = new File("/home/mdecorde/TXM/corpora/temoignages/docfiles/")
4 321 mdecorde
File outdir = new File("/home/mdecorde/TXM/corpora/temoignages/HTML/TEMOIGNAGES/default/Pictures")
5 321 mdecorde
outdir.deleteDir()
6 321 mdecorde
outdir.mkdir()
7 321 mdecorde
8 321 mdecorde
for(def subdir : dir.listFiles()) {
9 321 mdecorde
        if (subdir.isDirectory()) {
10 321 mdecorde
                File picturesDir = new File(subdir, "Pictures")
11 321 mdecorde
                for (def img : picturesDir.listFiles()) {
12 321 mdecorde
                        img.renameTo(new File(outdir, img.getName()))
13 321 mdecorde
                }
14 321 mdecorde
        }
15 321 mdecorde
}