You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by mi...@apache.org on 2010/04/29 16:47:57 UTC
svn commit: r939334 -
/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.web.fileserver/src/main/java/org/apache/clerezza/web/fileserver/util/StaticWebResource.java
Author: mir
Date: Thu Apr 29 14:47:57 2010
New Revision: 939334
URL: http://svn.apache.org/viewvc?rev=939334&view=rev
Log:
CLEREZZA-200: modifid StaticWebResource
Modified:
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.web.fileserver/src/main/java/org/apache/clerezza/web/fileserver/util/StaticWebResource.java
Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.web.fileserver/src/main/java/org/apache/clerezza/web/fileserver/util/StaticWebResource.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.web.fileserver/src/main/java/org/apache/clerezza/web/fileserver/util/StaticWebResource.java?rev=939334&r1=939333&r2=939334&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.web.fileserver/src/main/java/org/apache/clerezza/web/fileserver/util/StaticWebResource.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.web.fileserver/src/main/java/org/apache/clerezza/web/fileserver/util/StaticWebResource.java Thu Apr 29 14:47:57 2010
@@ -1,18 +1,20 @@
/*
- * Copyright 2010 mir.
- *
- * 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.
- * under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.clerezza.web.fileserver.util;
@@ -37,20 +39,19 @@ import org.wymiwyg.commons.util.dirbrows
*/
public class StaticWebResource {
- @Reference
private FileServer fileServer;
-
- protected String getFilePath() {
- return null;
- }
- protected void activate(ComponentContext context) throws Exception{
+ protected void setupStaticWeb(ComponentContext context) {
+ setupStaticWeb(context, "staticweb", false);
+ }
+
+ protected void setupStaticWeb(ComponentContext context, String path, boolean local) {
Bundle bundle = context.getBundleContext().getBundle();
- URL resourceDir = getClass().getResource("staticweb");
PathNode pathNode;
- if (getFilePath() != null) {
- pathNode = new FilePathNode(getFilePath());
+ if (local) {
+ pathNode = new FilePathNode(path);
} else {
+ URL resourceDir = getClass().getResource(path);
pathNode = new BundlePathNode(bundle, resourceDir.getPath());
}
fileServer = new FileServer(pathNode);