import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.buf.HexUtils;
+import org.apache.tomcat.util.res.StringManager;
/**
* This factory is used to read files and write files by splitting them up into
public class FileMessageFactory {
/*--Static Variables----------------------------------------*/
private static final Log log = LogFactory.getLog(FileMessageFactory.class);
+ private static final StringManager sm =
+ StringManager.getManager(Constants.Package);
/**
* The number of bytes that we read from file
log.debug("open file " + f + " write " + openForWrite);
if (openForWrite) {
if (!file.exists())
- file.createNewFile();
+ if (!file.createNewFile()) {
+ throw new IOException(sm.getString("fileNewFail", file));
+ }
out = new FileOutputStream(f);
} else {
size = file.length();
+ " war: "
+ msg.getFileName()
+ " data: "
- + msg.getData()
+ + HexUtils.toHexString(msg.getData())
+ " data length: " + msg.getDataLength() + " ]");
return false;
}
+ " war: "
+ msg.getFileName()
+ " data: "
- + msg.getData()
+ + HexUtils.toHexString(msg.getData())
+ " data length: " + msg.getDataLength() + " ]");
return false;
}
# See the License for the specific language governing permissions and
# limitations under the License.
+fileNewFail=Unable to create [{0}]
+
farmWarDeployer.deleteFail=Failed to delete [{0}]
farmWarDeployer.deployEnd=Deployment from [{0}] finished.
farmWarDeployer.fileCopyFail=Unable to copy from [{0}] to [{1}]
-farmWarDeployer.fileNewFail=Unable to create [{0}]
farmWarDeployer.hostOnly=FarmWarDeployer can only work as host cluster subelement!
farmWarDeployer.hostParentEngine=FarmWarDeployer can only work if parent of [{0}] is an engine!
farmWarDeployer.mbeanNameFail=Can't construct MBean object name for engine [{0}] and host [{1}]