Author: remy.maucherat(a)jboss.com
Date: 2012-10-03 04:12:39 -0400 (Wed, 03 Oct 2012)
New Revision: 2098
Added:
branches/7.2.x/src/main/java/org/jboss/web/FileUploadMessages.java
Modified:
branches/7.2.x/src/main/java/org/apache/jasper/tagplugins/jstl/Util.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUtils.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java
Log:
Visual inspection of util (part 3) classes for i18n
Modified: branches/7.2.x/src/main/java/org/apache/jasper/tagplugins/jstl/Util.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/jasper/tagplugins/jstl/Util.java 2012-10-03
08:11:09 UTC (rev 2097)
+++ branches/7.2.x/src/main/java/org/apache/jasper/tagplugins/jstl/Util.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -18,6 +18,8 @@
package org.apache.jasper.tagplugins.jstl;
+import static org.jboss.web.JasperMessages.MESSAGES;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
@@ -234,8 +236,7 @@
return url;
} else {
if (!context.startsWith("/") || !url.startsWith("/")) {
- throw new JspTagException(
- "In URL tags, when the \"context\" attribute is specified,
values of both \"context\" and \"url\" must start with
\"/\".");
+ throw new JspTagException(MESSAGES.invalidContextAndUrlValues());
}
if (context.equals("/")) {
// Don't produce string starting with '//', many
@@ -272,16 +273,14 @@
public PrintWriter getWriter() {
if (isStreamUsed)
- throw new IllegalStateException("Unexpected internal error during
<import>: " +
- "Target servlet called getWriter(), then getOutputStream()");
+ throw MESSAGES.usedOutputStreamAfterWriter();
isWriterUsed = true;
return new PrintWriter(sw);
}
public ServletOutputStream getOutputStream() {
if (isWriterUsed)
- throw new IllegalStateException("Unexpected internal error during
<import>: " +
- "Target servlet called getOutputStream(), then getWriter()");
+ throw MESSAGES.usedWriterAfterOutputStream();
isStreamUsed = true;
return sos;
}
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -81,8 +83,7 @@
*/
public ByteArrayOutputStream(int size) {
if (size < 0) {
- throw new IllegalArgumentException(
- "Negative initial size: " + size);
+ throw MESSAGES.negativeBufferSize(size);
}
needNewBuffer(size);
}
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -122,7 +124,7 @@
{
this(threshold, (File)null);
if (prefix == null) {
- throw new IllegalArgumentException("Temporary file prefix is
missing");
+ throw MESSAGES.missingTemporaryFilePrefix();
}
this.prefix = prefix;
this.suffix = suffix;
@@ -250,7 +252,7 @@
// a file or memory.
if (!closed)
{
- throw new IOException("Stream not closed");
+ throw new IOException(MESSAGES.streamNotClosed());
}
if(isInMemory())
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.File;
import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;
@@ -84,7 +86,7 @@
*/
public void track(File file, Object marker, FileDeleteStrategy deleteStrategy) {
if (file == null) {
- throw new NullPointerException("The file must not be null");
+ throw MESSAGES.nullFile();
}
addTracker(file.getPath(), marker, deleteStrategy);
}
@@ -114,7 +116,7 @@
*/
public void track(String path, Object marker, FileDeleteStrategy deleteStrategy) {
if (path == null) {
- throw new NullPointerException("The path must not be null");
+ throw MESSAGES.nullPath();
}
addTracker(path, marker, deleteStrategy);
}
@@ -129,7 +131,7 @@
private synchronized void addTracker(String path, Object marker, FileDeleteStrategy
deleteStrategy) {
// synchronized block protects reaper
if (exitWhenFinished) {
- throw new IllegalStateException("No new trackers can be added once
exitWhenFinished() is called");
+ throw MESSAGES.cannotAddTrackersOnceFinished();
}
if (reaper == null) {
reaper = new Reaper();
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
@@ -92,7 +94,7 @@
*/
public void delete(File fileToDelete) throws IOException {
if (fileToDelete.exists() && doDelete(fileToDelete) == false) {
- throw new IOException("Deletion failed: " + fileToDelete);
+ throw new
IOException(MESSAGES.failedToDelete(fileToDelete.getAbsolutePath()));
}
}
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
@@ -26,8 +28,6 @@
import java.util.Map;
import java.util.NoSuchElementException;
-import javax.servlet.http.HttpServletRequest;
-
import org.apache.tomcat.util.http.fileupload.MultipartStream.ItemInputStream;
import org.apache.tomcat.util.http.fileupload.util.Closeable;
import org.apache.tomcat.util.http.fileupload.util.FileItemHeadersImpl;
@@ -304,8 +304,7 @@
FileItemIterator iter = getItemIterator(ctx);
FileItemFactory fac = getFileItemFactory();
if (fac == null) {
- throw new NullPointerException(
- "No FileItemFactory has been set.");
+ throw MESSAGES.nullFactory();
}
while (iter.hasNext()) {
final FileItemStream item = iter.next();
@@ -321,9 +320,8 @@
} catch (FileUploadIOException e) {
throw (FileUploadException) e.getCause();
} catch (IOException e) {
- throw new IOFileUploadException(
- "Processing of " + MULTIPART_FORM_DATA
- + " request failed. " + e.getMessage(), e);
+ throw new IOFileUploadException(MESSAGES.multipartProcessingFailed
+ (MULTIPART_FORM_DATA, e.getMessage()), e);
}
if (fileItem instanceof FileItemHeadersSupport) {
final FileItemHeaders fih = item.getHeaders();
@@ -528,8 +526,7 @@
for (;;) {
int offset = headerPart.indexOf('\r', index);
if (offset == -1 || offset + 1 >= headerPart.length()) {
- throw new IllegalStateException(
- "Expected headers to be terminated by an empty line.");
+ throw MESSAGES.emptyLineAfterHeaders();
}
if (headerPart.charAt(offset + 1) == '\n') {
return offset;
@@ -608,12 +605,8 @@
if (pContentLength != -1
&& pContentLength > fileSizeMax) {
FileSizeLimitExceededException e =
- new FileSizeLimitExceededException(
- "The field " + fieldName
- + " exceeds its maximum permitted "
- + " size of " + fileSizeMax
- + " bytes.",
- pContentLength, fileSizeMax);
+ new
FileSizeLimitExceededException(MESSAGES.maxFieldSizeExceeded(fieldName, fileSizeMax),
+ pContentLength, fileSizeMax);
e.setFileName(pName);
e.setFieldName(pFieldName);
throw new FileUploadIOException(e);
@@ -624,11 +617,7 @@
throws IOException {
itemStream.close(true);
FileSizeLimitExceededException e =
- new FileSizeLimitExceededException(
- "The field " + fieldName
- + " exceeds its maximum permitted "
- + " size of " + pSizeMax
- + " bytes.",
+ new
FileSizeLimitExceededException(MESSAGES.maxFieldSizeExceeded(fieldName, pSizeMax),
pCount, pSizeMax);
e.setFieldName(fieldName);
e.setFileName(name);
@@ -684,8 +673,7 @@
*/
public InputStream openStream() throws IOException {
if (opened) {
- throw new IllegalStateException(
- "The stream was already opened.");
+ throw MESSAGES.streamAlreadyOpened();
}
if (((Closeable) stream).isClosed()) {
throw new FileItemStream.ItemSkippedException();
@@ -762,19 +750,14 @@
FileItemIteratorImpl(RequestContext ctx)
throws FileUploadException, IOException {
if (ctx == null) {
- throw new NullPointerException("ctx parameter");
+ throw MESSAGES.nullContext();
}
String contentType = ctx.getContentType();
if ((null == contentType)
|| (!contentType.toLowerCase(Locale.ENGLISH).startsWith(MULTIPART)))
{
- throw new InvalidContentTypeException(
- "the request doesn't contain a "
- + MULTIPART_FORM_DATA
- + " or "
- + MULTIPART_MIXED
- + " stream, content type header is "
- + contentType);
+ throw new InvalidContentTypeException(MESSAGES.invalidContentType
+ (MULTIPART_FORM_DATA, MULTIPART_MIXED, contentType));
}
InputStream input = ctx.getInputStream();
@@ -787,22 +770,14 @@
protected void raiseError(long pSizeMax, long pCount)
throws IOException {
FileUploadException ex =
- new SizeLimitExceededException(
- "the request was rejected because"
- + " its size (" + pCount
- + ") exceeds the configured maximum"
- + " (" + pSizeMax + ")",
+ new
SizeLimitExceededException(MESSAGES.maxRequestSizeExceeded(pCount, pSizeMax),
pCount, pSizeMax);
throw new FileUploadIOException(ex);
}
};
} else {
if (sizeMax >= 0 && requestSize > sizeMax) {
- throw new SizeLimitExceededException(
- "the request was rejected because its size ("
- + requestSize
- + ") exceeds the configured maximum ("
- + sizeMax + ")",
+ throw new
SizeLimitExceededException(MESSAGES.maxRequestSizeExceeded(requestSize, sizeMax),
requestSize, sizeMax);
}
}
@@ -815,9 +790,7 @@
boundary = getBoundary(contentType);
if (boundary == null) {
- throw new FileUploadException(
- "the request was rejected because "
- + "no multipart boundary was found");
+ throw new FileUploadException(MESSAGES.missingMultipartBoundary());
}
notifier = new MultipartStream.ProgressNotifier(listener,
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUtils.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUtils.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/FileUtils.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -79,9 +81,7 @@
cleanDirectory(directory);
if (!directory.delete()) {
- String message =
- "Unable to delete directory " + directory + ".";
- throw new IOException(message);
+ throw new
IOException(MESSAGES.failedToDeleteDirectory(directory.getPath()));
}
}
@@ -95,18 +95,16 @@
*/
public static void cleanDirectory(File directory) throws IOException {
if (!directory.exists()) {
- String message = directory + " does not exist";
- throw new IllegalArgumentException(message);
+ throw MESSAGES.missingDirectory(directory.getPath());
}
if (!directory.isDirectory()) {
- String message = directory + " is not a directory";
- throw new IllegalArgumentException(message);
+ throw MESSAGES.notDirectory(directory.getPath());
}
File[] files = directory.listFiles();
if (files == null) { // null if security restricted
- throw new IOException("Failed to list contents of " + directory);
+ throw new IOException(MESSAGES.failedListingDirectory(directory.getPath()));
}
IOException exception = null;
@@ -148,11 +146,9 @@
boolean filePresent = file.exists();
if (!file.delete()) {
if (!filePresent){
- throw new FileNotFoundException("File does not exist: " +
file);
+ throw new
FileNotFoundException(MESSAGES.missingFile(file.getPath()));
}
- String message =
- "Unable to delete file: " + file;
- throw new IOException(message);
+ throw new IOException(MESSAGES.failedToDelete(file.getPath()));
}
}
}
@@ -198,18 +194,16 @@
*/
private static void cleanDirectoryOnExit(File directory) throws IOException {
if (!directory.exists()) {
- String message = directory + " does not exist";
- throw new IllegalArgumentException(message);
+ throw MESSAGES.missingDirectory(directory.getPath());
}
if (!directory.isDirectory()) {
- String message = directory + " is not a directory";
- throw new IllegalArgumentException(message);
+ throw MESSAGES.notDirectory(directory.getPath());
}
File[] files = directory.listFiles();
if (files == null) { // null if security restricted
- throw new IOException("Failed to list contents of " + directory);
+ throw new IOException(MESSAGES.failedListingDirectory(directory.getPath()));
}
IOException exception = null;
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -375,7 +377,7 @@
tail = input.read(buffer, head, bufSize);
if (tail == -1) {
// No more data available.
- throw new IOException("No more data is available");
+ throw new IOException(MESSAGES.noDataAvailable());
}
if (notifier != null) {
notifier.noteBytesRead(tail);
@@ -419,11 +421,10 @@
} else if (arrayequals(marker, FIELD_SEPARATOR, 2)) {
nextChunk = true;
} else {
- throw new MalformedStreamException(
- "Unexpected characters follow a boundary");
+ throw new
MalformedStreamException(MESSAGES.unexpectedCharactersAfterBoundary());
}
} catch (IOException e) {
- throw new MalformedStreamException("Stream ended unexpectedly");
+ throw new MalformedStreamException(MESSAGES.unexpectedEndOfStream());
}
return nextChunk;
}
@@ -451,8 +452,7 @@
public void setBoundary(byte[] boundary)
throws IllegalBoundaryException {
if (boundary.length != boundaryLength - BOUNDARY_PREFIX.length) {
- throw new IllegalBoundaryException(
- "The length of a boundary token can not be changed");
+ throw new IllegalBoundaryException(MESSAGES.invalidBoundaryToken());
}
System.arraycopy(boundary, 0, this.boundary, BOUNDARY_PREFIX.length,
boundary.length);
@@ -485,12 +485,10 @@
try {
b = readByte();
} catch (IOException e) {
- throw new MalformedStreamException("Stream ended
unexpectedly");
+ throw new MalformedStreamException(MESSAGES.unexpectedEndOfStream());
}
if (++size > HEADER_PART_SIZE_MAX) {
- throw new MalformedStreamException(
- "Header section has more than " + HEADER_PART_SIZE_MAX
- + " bytes (maybe it is not properly terminated)");
+ throw new
MalformedStreamException(MESSAGES.invalidHeader(HEADER_PART_SIZE_MAX));
}
if (b == HEADER_SEPARATOR[i]) {
i++;
@@ -939,8 +937,7 @@
// The last pad amount is left in the buffer.
// Boundary can't be in there so signal an error
// condition.
- final String msg = "Stream ended unexpectedly";
- throw new MalformedStreamException(msg);
+ throw new
MalformedStreamException(MESSAGES.unexpectedEndOfStream());
}
if (notifier != null) {
notifier.noteBytesRead(bytesRead);
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload.disk;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
@@ -472,8 +474,7 @@
* For whatever reason we cannot write the
* file to disk.
*/
- throw new FileUploadException(
- "Cannot write uploaded file to disk!");
+ throw new FileUploadException(MESSAGES.errorWritingUpload());
}
}
}
Modified:
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/util/Streams.java 2012-10-03
08:11:09 UTC (rev 2097)
+++
branches/7.2.x/src/main/java/org/apache/tomcat/util/http/fileupload/util/Streams.java 2012-10-03
08:12:39 UTC (rev 2098)
@@ -16,6 +16,8 @@
*/
package org.apache.tomcat.util.http.fileupload.util;
+import static org.jboss.web.FileUploadMessages.MESSAGES;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -191,7 +193,7 @@
}
}
throw new InvalidFileNameException(pFileName,
- "Invalid file name: " + sb);
+ MESSAGES.invalidFileName(sb.toString()));
}
return pFileName;
}
Added: branches/7.2.x/src/main/java/org/jboss/web/FileUploadMessages.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/FileUploadMessages.java
(rev 0)
+++ branches/7.2.x/src/main/java/org/jboss/web/FileUploadMessages.java 2012-10-03 08:12:39
UTC (rev 2098)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012 Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.web;
+
+import org.jboss.logging.Cause;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * Logging IDs 8200-8500
+ * @author Remy Maucherat
+ */
+@MessageBundle(projectCode = "JBWEB")
+public interface FileUploadMessages {
+
+ /**
+ * The messages
+ */
+ FileUploadMessages MESSAGES = Messages.getBundle(FileUploadMessages.class);
+
+ @Message(id = 8200, value = "Negative initial size: %s")
+ IllegalArgumentException negativeBufferSize(int size);
+
+ @Message(id = 8201, value = "Temporary file prefix is missing")
+ IllegalArgumentException missingTemporaryFilePrefix();
+
+ @Message(id = 8202, value = "Stream not closed")
+ String streamNotClosed();
+
+ @Message(id = 8203, value = "Null file")
+ NullPointerException nullFile();
+
+ @Message(id = 8204, value = "Null path")
+ NullPointerException nullPath();
+
+ @Message(id = 8205, value = "No new trackers can be added once finished")
+ IllegalStateException cannotAddTrackersOnceFinished();
+
+ @Message(id = 8206, value = "Deletion failed: %s")
+ String failedToDelete(String file);
+
+ @Message(id = 8207, value = "No FileItemFactory has been set")
+ NullPointerException nullFactory();
+
+ @Message(id = 8208, value = "Processing of %s request failed: %s")
+ String multipartProcessingFailed(String multipart, String message);
+
+ @Message(id = 8209, value = "Expected headers to be terminated by an empty
line")
+ IllegalStateException emptyLineAfterHeaders();
+
+ @Message(id = 8210, value = "The field %s exceeds its maximum permitted size of
%s bytes")
+ String maxFieldSizeExceeded(String field, long maxFileSize);
+
+ @Message(id = 8211, value = "The stream was already opened")
+ IllegalStateException streamAlreadyOpened();
+
+ @Message(id = 8212, value = "Null context")
+ NullPointerException nullContext();
+
+ @Message(id = 8213, value = "The request doesn't contain a %s or %s stream,
content type header is %s")
+ String invalidContentType(String multipartForm, String multipartMixed, String
contentType);
+
+ @Message(id = 8214, value = "The request was rejected because its size (%s)
exceeds the configured maximum (%s)")
+ String maxRequestSizeExceeded(long requestSize, long maxRequestSize);
+
+ @Message(id = 8215, value = "The request was rejected because no multipart
boundary was found")
+ String missingMultipartBoundary();
+
+ @Message(id = 8216, value = "Unable to delete directory %s")
+ String failedToDeleteDirectory(String directory);
+
+ @Message(id = 8217, value = "Directory %s does not exist")
+ IllegalArgumentException missingDirectory(String directory);
+
+ @Message(id = 8218, value = "Path %s is not a directory")
+ IllegalArgumentException notDirectory(String directory);
+
+ @Message(id = 8219, value = "Failed listing contents of directory %s")
+ String failedListingDirectory(String directory);
+
+ @Message(id = 8220, value = "File %s does not exist")
+ String missingFile(String file);
+
+ @Message(id = 8221, value = "Unable to delete file %s")
+ String failedToDeleteFile(String file);
+
+ @Message(id = 8222, value = "No more data is available")
+ String noDataAvailable();
+
+ @Message(id = 8223, value = "Unexpected characters follow a boundary")
+ String unexpectedCharactersAfterBoundary();
+
+ @Message(id = 8224, value = "Stream ended unexpectedly")
+ String unexpectedEndOfStream();
+
+ @Message(id = 8225, value = "The length of a boundary token can not be
changed")
+ String invalidBoundaryToken();
+
+ @Message(id = 8226, value = "Header section has more than %s bytes (maybe it is
not properly terminated)")
+ String invalidHeader(int maxHeaderSize);
+
+ @Message(id = 8227, value = "Cannot write uploaded file to disk")
+ String errorWritingUpload();
+
+ @Message(id = 8228, value = "Invalid file name: %s")
+ String invalidFileName(String fileName);
+
+}
Modified: branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java 2012-10-03 08:11:09 UTC
(rev 2097)
+++ branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java 2012-10-03 08:12:39 UTC
(rev 2098)
@@ -772,4 +772,13 @@
@Message(id = 4244, value = "White space is required between the processing
instruction target and data.")
String requiredWhiteSpaceAfterPiTarget();
+ @Message(id = 4245, value = "In URL tags, when the \"context\"
attribute is specified, values of both \"context\" and \"url\" must
start with '/'.")
+ String invalidContextAndUrlValues();
+
+ @Message(id = 4246, value = "Unexpected internal error during
<import>: Target servlet called getWriter(), then getOutputStream()")
+ IllegalStateException usedOutputStreamAfterWriter();
+
+ @Message(id = 4247, value = "Unexpected internal error during
<import>: Target servlet called getOutputStream(), then getWriter()")
+ IllegalStateException usedWriterAfterOutputStream();
+
}