Author: markt
Date: Sun Sep 16 19:34:29 2012
New Revision: 1385355
URL: http://svn.apache.org/viewvc?rev=1385355&view=rev
Log:
Complete the i18n TODOs
Modified:
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/LocalStrings.properties
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
Modified:
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/LocalStrings.properties?rev=1385355&r1=1385354&r2=1385355&view=diff
==============================================================================
---
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/LocalStrings.properties
(original)
+++
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/LocalStrings.properties
Sun Sep 16 19:34:29 2012
@@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+abstractResource.getContentFail=Unable to return [{0}] as a byte array
+abstractResource.getContentTooLarge=Unable to return [{0}] as a byte array
since the resource is [{1}] bytes in size which is larger than the maximum size
of a byte array
+
dirResourceSet.writeExists=The target of the write already exists
dirResourceSet.writeNpe=The input stream may not be null
@@ -23,5 +26,8 @@ fileResource.getUrlFail=Unable to determ
jarResource.getInputStreamFail=Unable to obtain an InputStream for the
resource [{0}] located in the JAR [{1}]
jarResource.getUrlFail=Unable to determine a URL for the resource [{0}]
located in the JAR [{1}]
-abstractResource.getContentFail=Unable to return [{0}] as a byte array
-abstractResource.getContentTooLarge=Unable to return [{0}] as a byte array
since the resource is [{1}] bytes in size which is larger than the maximum size
of a byte array
\ No newline at end of file
+standardRoot.checkStateNotStarted=The resources may not be accessed if they
are not currently started
+standardRoot.createInvalidFile=Unable to create WebResourceSet from [{0}]
+standardRoot.createNoFileResourceSet=The FileResourceSet feature has not yet
been implemented
+standardRoot.createUnknownType=Unable to create WebResourceSet of unknown type
[{0}]
+standardRoot.startInvalidMain=The main resource set specified [{0}] is not
valid
\ No newline at end of file
Modified:
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
URL:
http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java?rev=1385355&r1=1385354&r2=1385355&view=diff
==============================================================================
---
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
(original)
+++
tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/StandardRoot.java
Sun Sep 16 19:34:29 2012
@@ -34,6 +34,7 @@ import org.apache.catalina.WebResource;
import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.WebResourceSet;
import org.apache.catalina.util.LifecycleMBeanBase;
+import org.apache.tomcat.util.res.StringManager;
/**
* Provides the resources implementation for a web application. The
@@ -43,6 +44,9 @@ import org.apache.catalina.util.Lifecycl
public class StandardRoot extends LifecycleMBeanBase
implements WebResourceRoot {
+ protected static final StringManager sm =
+ StringManager.getManager(Constants.Package);
+
private final Context context;
private ArrayList<WebResourceSet> preResources = new ArrayList<>();
private WebResourceSet main;
@@ -208,7 +212,8 @@ public class StandardRoot extends Lifecy
resourceList = postResources;
break;
default:
- throw new IllegalArgumentException("TODO i18n - Unknown type");
+ throw new IllegalArgumentException(
+ sm.getString("standardRoot.createUnknownType", type));
}
if (file.isFile()) {
@@ -216,13 +221,15 @@ public class StandardRoot extends Lifecy
resourceSet = new JarResourceSet(this, file, webAppPath,
internalPath);
} else {
- throw new UnsupportedOperationException("No FileResourceSet
class");
+ throw new UnsupportedOperationException(
+ sm.getString("standardRoot.createNoFileResourceSet"));
}
} else if (file.isDirectory()) {
resourceSet =
new DirResourceSet(this, file, webAppPath, internalPath);
} else {
- throw new IllegalArgumentException("TODO i18n - invalid file");
+ throw new IllegalArgumentException(
+ sm.getString("standardRoot.createInvalidFile", file));
}
resourceList.add(resourceSet);
@@ -246,7 +253,7 @@ public class StandardRoot extends Lifecy
private void checkState() {
if (!getState().isAvailable()) {
throw new IllegalStateException(
- "TODO - i18n: Can't access resources before they are
started");
+ sm.getString("standardRoot.checkStateNotStarted"));
}
}
@@ -301,7 +308,7 @@ public class StandardRoot extends Lifecy
main = new JarResourceSet(this, f, "", "");
} else {
throw new IllegalArgumentException(
- "TODO - i18n: Invalid main resoucres");
+ sm.getString("standardRoot.startInvalidMain"));
}
mainResources.clear();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]