jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1091484 - in /jackrabbit/trunk/jackrabbit-jcr-commons/src: main/java/org/apache/jackrabbit/commons/privilege/ test/java/org/apache/jackrabbit/commons/privilege/ test/resources/org/apache/jackrabbit/commons/privilege/
Date Tue, 12 Apr 2011 15:53:14 GMT
Author: angela
Date: Tue Apr 12 15:53:13 2011
New Revision: 1091484

URL: http://svn.apache.org/viewvc?rev=1091484&view=rev
Log:
JCR-2940 - fixing license header

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/privilege/PrivilegeXmlHandler.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/privilege/PrivilegeHandlerTest.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/readtest.xml
    jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/writetest.xml

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/privilege/PrivilegeXmlHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/privilege/PrivilegeXmlHandler.java?rev=1091484&r1=1091483&r2=1091484&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/privilege/PrivilegeXmlHandler.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/privilege/PrivilegeXmlHandler.java
Tue Apr 12 15:53:13 2011
@@ -70,6 +70,26 @@ class PrivilegeXmlHandler implements Pri
 
     private static final String ATTR_XMLNS = "xmlns:";
 
+    private static final String LICENSE_HEADER = createLicenseHeader();
+
+    private static String createLicenseHeader() {
+        return "\n" +                
+                    "   Licensed to the Apache Software Foundation (ASF) under one or more\n"
+
+                    "   contributor license agreements.  See the NOTICE file distributed
with\n" +
+                    "   this work for additional information regarding copyright ownership.\n"
+
+                    "   The ASF licenses this file to You under the Apache License, Version
2.0\n" +
+                    "   (the \"License\"); you may not use this file except in compliance
with\n" +
+                    "   the License.  You may obtain a copy of the License at\n" +
+                    "\n" +
+                    "       http://www.apache.org/licenses/LICENSE-2.0\n" +
+                    "\n" +
+                    "   Unless required by applicable law or agreed to in writing, software\n"
+
+                    "   distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+
+                    "   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+
+                    "   See the License for the specific language governing permissions and\n"
+
+                    "   limitations under the License.\n";
+    }
+
     /**
      * Constant for <code>DocumentBuilderFactory</code>.
      */
@@ -78,7 +98,7 @@ class PrivilegeXmlHandler implements Pri
     private static DocumentBuilderFactory createFactory() {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setNamespaceAware(true);
-        factory.setIgnoringComments(true);
+        factory.setIgnoringComments(false);
         factory.setIgnoringElementContentWhitespace(true);
         return factory;
     }
@@ -150,6 +170,7 @@ class PrivilegeXmlHandler implements Pri
         try {
             DocumentBuilder builder = createDocumentBuilder();
             Document doc = builder.newDocument();
+            doc.appendChild(doc.createComment(LICENSE_HEADER));
             Element privileges = (Element) doc.appendChild(doc.createElement(XML_PRIVILEGES));
 
             for (String prefix : namespaces.keySet()) {
@@ -253,4 +274,4 @@ class PrivilegeXmlHandler implements Pri
     private static boolean isElement(Node n) {
         return n.getNodeType() == Node.ELEMENT_NODE;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/privilege/PrivilegeHandlerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/privilege/PrivilegeHandlerTest.java?rev=1091484&r1=1091483&r2=1091484&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/privilege/PrivilegeHandlerTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/commons/privilege/PrivilegeHandlerTest.java
Tue Apr 12 15:53:13 2011
@@ -1,13 +1,18 @@
 /*
- * Copyright 1997-2011 Day Management AG
- * Barfuesserplatz 6, 4001 Basel, Switzerland
- * All Rights Reserved.
+ * 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
  *
- * This software is the confidential and proprietary information of
- * Day Management AG, ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Day.
+ *      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.jackrabbit.commons.privilege;
 
@@ -84,4 +89,4 @@ public class PrivilegeHandlerTest extend
         assertEquals("Write", expected, result);
     }
 
-}
\ No newline at end of file
+}

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/readtest.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/readtest.xml?rev=1091484&r1=1091483&r2=1091484&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/readtest.xml
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/readtest.xml
Tue Apr 12 15:53:13 2011
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+-->
 <privileges xmlns:foo="http://www.foo.com/1.0">
     <privilege name="foo:testRead"/>
     <privilege name="foo:testWrite"/>
@@ -8,4 +24,4 @@
         <contains name="foo:testRead"/>
         <contains name="foo:testWrite"/>
     </privilege>
-</privileges>
\ No newline at end of file
+</privileges>

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/writetest.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/writetest.xml?rev=1091484&r1=1091483&r2=1091484&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/writetest.xml
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/test/resources/org/apache/jackrabbit/commons/privilege/writetest.xml
Tue Apr 12 15:53:13 2011
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+   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.
+-->
 <privileges xmlns:foo="http://www.foo.com/1.0">
 <privilege abstract="false" name="foo:testRead"/>
 <privilege abstract="false" name="foo:testWrite"/>
@@ -8,4 +24,4 @@
 <contains name="foo:testRead"/>
 <contains name="foo:testWrite"/>
 </privilege>
-</privileges>
\ No newline at end of file
+</privileges>



Mime
View raw message