1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Document doc = DiaporamaXmlGenerator.generateDiaporamaXml(xdp);
XMLOutputter outputter = new XMLOutputter();
ftp.changeWorkingDirectory(cadre.getActivation());
OutputStream out = ftp.storeFileStream(Configuration.getProperty(FRAME_SERVER_XDIAPO_NAME));
outputter.output(doc, out);
out.flush();
out.close();
ftp.setFileType(FTP.BINARY_FILE_TYPE);
for (XDiapoPlan x : xdp) {
if (photoControl.put(x.getPhotoId(),"")==null) {
ipi = CommonUtils.parsePhotoVersionForFileInfo(Long.parseLong(x.getPhotoId()));
if (ipi.getSubPathKey().equals("")) {
path=(new StringBuilder(Configuration.getProperty(RES_PATH))).append(separator).append(ipi.getNode()).append(separator).append(RESOURCE_LEAF_FRAME).append(separator);
} else {
path=(new StringBuilder(Configuration.getProperty(RES_PATH))).append(separator).append(ipi.getNode()).append(separator).append(ipi.getPath()).append(separator).append(RESOURCE_LEAF_FRAME).append(separator);
}
fileName = new StringBuilder();
fileName.append(EXT_FRAME+ipi.getFileName()).append('.').append(DEFAULT_EXTENSION);
path.append(separator).append(fileName);
fis = new FileInputStream(path.toString());
ok=false;
i=0;
while (!ok && i<=5) {
ok=ftp.storeFile(fileName.toString(),fis); // Et ici, parfois, j'ai des fichiers avec une taille à 0
list.add(fileName.toString());
i++;
}
fis.close();
}
} |
Partager