| | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.util.logging.Logger; |
| | | import java.util.logging.Level; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * Upgrade's Log. |
| | | */ |
| | | static private final Logger LOG = Logger |
| | | .getLogger(UpgradeCli.class.getName()); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | LOG.log(Level.INFO, new StringBuilder("File '").append(file.toString()) |
| | | .append("' does not exist").toString()); |
| | | logger.debug(LocalizableMessage.raw(new StringBuilder("File '").append(file.toString()) |
| | | .append("' does not exist").toString())); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | final LocalizableMessage message = LocalizableMessage.raw("Copying file '%s' to '%s'", |
| | | objectFile.getAbsolutePath(), destination.getAbsolutePath()); |
| | | LOG.log(Level.INFO, message.toString()); |
| | | logger.debug(LocalizableMessage.raw(message.toString())); |
| | | FileInputStream fis = null; |
| | | FileOutputStream fos = null; |
| | | try |
| | |
| | | { |
| | | final LocalizableMessage errMsg = INFO_ERROR_COPYING_FILE.get( |
| | | objectFile.getAbsolutePath(), destination.getAbsolutePath()); |
| | | LOG.log(Level.SEVERE, errMsg.toString()); |
| | | logger.error(LocalizableMessage.raw(errMsg.toString())); |
| | | throw new IOException(errMsg.toString()); |
| | | } |
| | | } |
| | |
| | | "Ignoring file '%s' since '%s' already exists", |
| | | objectFile.getAbsolutePath(), destination.getAbsolutePath()); |
| | | |
| | | LOG.log(Level.INFO, message.toString()); |
| | | logger.debug(LocalizableMessage.raw(message.toString())); |
| | | } |
| | | } |
| | | } |
| | |
| | | File file = getObjectFile(); |
| | | boolean isFile = file.isFile(); |
| | | |
| | | LOG.log(Level.INFO, "deleting " + (isFile ? " file " : " directory ") |
| | | + file.getAbsolutePath()); |
| | | logger.debug(LocalizableMessage.raw("deleting " + (isFile ? " file " : " directory ") |
| | | + file.getAbsolutePath())); |
| | | |
| | | boolean delete = false; |
| | | /* |