You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/02/25 20:57:05 UTC
svn commit: r511585 [10/10] - in
/webservices/axis2/trunk/java/modules/kernel:
src/org/apache/axis2/addressing/ src/org/apache/axis2/addressing/wsdl/
src/org/apache/axis2/builder/ src/org/apache/axis2/cluster/
src/org/apache/axis2/context/ src/org/apac...
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/interf/Actor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/interf/Actor.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/interf/Actor.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/interf/Actor.java Sun Feb 25 11:56:59 2007
@@ -1,26 +1,26 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.interf;
-
-/**
- * Interface Actor
- */
-
-public interface Actor {
- public void takeAction();
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.interf;
+
+/**
+ * Interface Actor
+ */
+
+public interface Actor {
+ public void takeAction();
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/interf/Actor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermission.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermission.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermission.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermission.java Sun Feb 25 11:56:59 2007
@@ -1,63 +1,63 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.less;
-
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.java.security.interf.Actor;
-
-import java.security.PrivilegedAction;
-
-
-
-/**
- * LessPermission has no read permission to the private.txt file
- */
-
-public class LessPermission implements Actor {
-
- private Actor _actor;
- private boolean _usingDoPrivilege;
-
- // Construtor
- public LessPermission(Actor a, boolean usingDoPrivilege) {
- _actor = a;
- _usingDoPrivilege = usingDoPrivilege;
- }
-
- // Implement Actor's takeAction method
- public void takeAction() {
- try {
- if (_usingDoPrivilege) {
- // Use AccessController's doPrivilege
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- _actor.takeAction();
- return null;
- }
- });
- }
- else {
- // Use no AccessController's doPrivilege
- _actor.takeAction();
- }
- } catch (Exception e) {
- e.printStackTrace(System.out);
- }
- }
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.less;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.java.security.interf.Actor;
+
+import java.security.PrivilegedAction;
+
+
+
+/**
+ * LessPermission has no read permission to the private.txt file
+ */
+
+public class LessPermission implements Actor {
+
+ private Actor _actor;
+ private boolean _usingDoPrivilege;
+
+ // Construtor
+ public LessPermission(Actor a, boolean usingDoPrivilege) {
+ _actor = a;
+ _usingDoPrivilege = usingDoPrivilege;
+ }
+
+ // Implement Actor's takeAction method
+ public void takeAction() {
+ try {
+ if (_usingDoPrivilege) {
+ // Use AccessController's doPrivilege
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ _actor.takeAction();
+ return null;
+ }
+ });
+ }
+ else {
+ // Use no AccessController's doPrivilege
+ _actor.takeAction();
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermission.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionAccessControlContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionAccessControlContext.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionAccessControlContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionAccessControlContext.java Sun Feb 25 11:56:59 2007
@@ -1,65 +1,65 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.less;
-
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.java.security.interf.Actor;
-
-import java.security.PrivilegedAction;
-import java.security.AccessControlContext;
-
-
-
-/**
- * LessPermission has no read permission to the private.txt file
- */
-
-public class LessPermissionAccessControlContext implements Actor {
-
- private Actor _actor;
- private boolean _usingDoPrivilege;
-
- // Construtor
- public LessPermissionAccessControlContext(Actor a, boolean usingDoPrivilege) {
- _actor = a;
- _usingDoPrivilege = usingDoPrivilege;
- }
-
- // Implement Actor's takeAction method
- public void takeAction() {
- try {
- if (_usingDoPrivilege) {
- final AccessControlContext acc = AccessController.getContext();
- // Demostrate the usage of AccessController.doPrivileged(PrivilegeAction action, AccessContext ctx)
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- _actor.takeAction();
- return null;
- }
- }, acc);
- }
- else {
- // Use no doPrivileged
- _actor.takeAction();
- }
- } catch (Exception e) {
- e.printStackTrace(System.out);
- }
- }
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.less;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.java.security.interf.Actor;
+
+import java.security.PrivilegedAction;
+import java.security.AccessControlContext;
+
+
+
+/**
+ * LessPermission has no read permission to the private.txt file
+ */
+
+public class LessPermissionAccessControlContext implements Actor {
+
+ private Actor _actor;
+ private boolean _usingDoPrivilege;
+
+ // Construtor
+ public LessPermissionAccessControlContext(Actor a, boolean usingDoPrivilege) {
+ _actor = a;
+ _usingDoPrivilege = usingDoPrivilege;
+ }
+
+ // Implement Actor's takeAction method
+ public void takeAction() {
+ try {
+ if (_usingDoPrivilege) {
+ final AccessControlContext acc = AccessController.getContext();
+ // Demostrate the usage of AccessController.doPrivileged(PrivilegeAction action, AccessContext ctx)
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ _actor.takeAction();
+ return null;
+ }
+ }, acc);
+ }
+ else {
+ // Use no doPrivileged
+ _actor.takeAction();
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionAccessControlContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionPrivilegedExceptionAction.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionPrivilegedExceptionAction.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionPrivilegedExceptionAction.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionPrivilegedExceptionAction.java Sun Feb 25 11:56:59 2007
@@ -1,63 +1,63 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.less;
-
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.java.security.interf.Actor;
-
-import java.security.PrivilegedExceptionAction;
-
-
-
-/**
- * LessPermission has no read permission to the private.txt file
- */
-
-public class LessPermissionPrivilegedExceptionAction implements Actor {
-
- private Actor _actor;
- private boolean _usingDoPrivilege;
-
- // Construtor
- public LessPermissionPrivilegedExceptionAction(Actor a, boolean usingDoPrivilege) {
- _actor = a;
- _usingDoPrivilege = usingDoPrivilege;
- }
-
- // Implement Actor's takeAction method
- public void takeAction() {
- try {
- if (_usingDoPrivilege) {
- // Demostrate the usage of AccessController.doPrivileged(PrivilegedExceptionAction action)
- AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Object run() {
- _actor.takeAction();
- return null;
- }
- });
- }
- else {
- // Use no doPrivileged
- _actor.takeAction();
- }
- } catch (Exception e) {
- e.printStackTrace(System.out);
- }
- }
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.less;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.java.security.interf.Actor;
+
+import java.security.PrivilegedExceptionAction;
+
+
+
+/**
+ * LessPermission has no read permission to the private.txt file
+ */
+
+public class LessPermissionPrivilegedExceptionAction implements Actor {
+
+ private Actor _actor;
+ private boolean _usingDoPrivilege;
+
+ // Construtor
+ public LessPermissionPrivilegedExceptionAction(Actor a, boolean usingDoPrivilege) {
+ _actor = a;
+ _usingDoPrivilege = usingDoPrivilege;
+ }
+
+ // Implement Actor's takeAction method
+ public void takeAction() {
+ try {
+ if (_usingDoPrivilege) {
+ // Demostrate the usage of AccessController.doPrivileged(PrivilegedExceptionAction action)
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction() {
+ public Object run() {
+ _actor.takeAction();
+ return null;
+ }
+ });
+ }
+ else {
+ // Use no doPrivileged
+ _actor.takeAction();
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/less/LessPermissionPrivilegedExceptionAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermission.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermission.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermission.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermission.java Sun Feb 25 11:56:59 2007
@@ -1,62 +1,62 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.more;
-
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.java.security.interf.Actor;
-
-import java.security.PrivilegedAction;
-
-/**
- * MorePermission has read permission to both public.txt and private.txt
- */
-
-public class MorePermission implements Actor {
-
- private Actor _actor;
- private boolean _usingDoPrivilege;
-
- // Constructor
- public MorePermission(Actor a, boolean usingDoPrivilege) {
- _actor = a;
- _usingDoPrivilege = usingDoPrivilege;
-
- }
-
- // Implementing Actor's takeAction method
- public void takeAction() {
- try {
- if (_usingDoPrivilege) {
- // Use AccessController's doPrivilege
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- _actor.takeAction();
- return null;
- }
- });
- }
- else {
- // Use no AccessController's doPrivilege
- _actor.takeAction();
- }
- } catch (Exception e) {
- e.printStackTrace(System.out);
- }
- }
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.more;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.java.security.interf.Actor;
+
+import java.security.PrivilegedAction;
+
+/**
+ * MorePermission has read permission to both public.txt and private.txt
+ */
+
+public class MorePermission implements Actor {
+
+ private Actor _actor;
+ private boolean _usingDoPrivilege;
+
+ // Constructor
+ public MorePermission(Actor a, boolean usingDoPrivilege) {
+ _actor = a;
+ _usingDoPrivilege = usingDoPrivilege;
+
+ }
+
+ // Implementing Actor's takeAction method
+ public void takeAction() {
+ try {
+ if (_usingDoPrivilege) {
+ // Use AccessController's doPrivilege
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ _actor.takeAction();
+ return null;
+ }
+ });
+ }
+ else {
+ // Use no AccessController's doPrivilege
+ _actor.takeAction();
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermission.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionAccessControlContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionAccessControlContext.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionAccessControlContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionAccessControlContext.java Sun Feb 25 11:56:59 2007
@@ -1,80 +1,80 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.more;
-
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.java.security.interf.Actor;
-
-import java.security.PrivilegedAction;
-import java.security.AccessControlContext;
-import java.security.Permission;
-
-/**
- * MorePermissionAccessControllerContext has read permission to both public.txt and private.txt
- */
-
-public class MorePermissionAccessControlContext implements Actor {
-
- private Actor _actor;
- private boolean _usingDoPrivilege;
-
- // Constructor
- public MorePermissionAccessControlContext(Actor a, boolean usingDoPrivilege) {
- _actor = a;
- _usingDoPrivilege = usingDoPrivilege;
-
- }
-
- // Implementing Actor's takeAction method
- public void takeAction() {
- try {
- if (_usingDoPrivilege) {
- final AccessControlContext acc = AccessController.getContext();
- // Print out maven's base,build, and test direcotories
- String baseDir = System.getProperty("basedir");
- System.out.println("basedir => " + baseDir);
-
- // Convert the \ (back slash) to / (forward slash)
- String baseDirM = baseDir.replace('\\', '/');
- System.out.println("baseDirM => "+ baseDirM);
-
- String fs = "/";
- String fileName = "private/private.txt";
-
- // Build the file URL
- String fileURL=baseDirM+fs+"test-resources"+fs+"java2sec"+fs+fileName;
- Permission perm = new java.io.FilePermission(fileURL, "read");
- acc.checkPermission(perm);
- // Demostrate the usage of AccessController's doPrivilege(PrivilegeAction action, AccessContext ctx)
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public Object run() {
- _actor.takeAction();
- return null;
- }
- }, acc);
- }
- else {
- // Use no doPrivileged
- _actor.takeAction();
- }
- } catch (Exception e) {
- e.printStackTrace(System.out);
- }
- }
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.more;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.java.security.interf.Actor;
+
+import java.security.PrivilegedAction;
+import java.security.AccessControlContext;
+import java.security.Permission;
+
+/**
+ * MorePermissionAccessControllerContext has read permission to both public.txt and private.txt
+ */
+
+public class MorePermissionAccessControlContext implements Actor {
+
+ private Actor _actor;
+ private boolean _usingDoPrivilege;
+
+ // Constructor
+ public MorePermissionAccessControlContext(Actor a, boolean usingDoPrivilege) {
+ _actor = a;
+ _usingDoPrivilege = usingDoPrivilege;
+
+ }
+
+ // Implementing Actor's takeAction method
+ public void takeAction() {
+ try {
+ if (_usingDoPrivilege) {
+ final AccessControlContext acc = AccessController.getContext();
+ // Print out maven's base,build, and test direcotories
+ String baseDir = System.getProperty("basedir");
+ System.out.println("basedir => " + baseDir);
+
+ // Convert the \ (back slash) to / (forward slash)
+ String baseDirM = baseDir.replace('\\', '/');
+ System.out.println("baseDirM => "+ baseDirM);
+
+ String fs = "/";
+ String fileName = "private/private.txt";
+
+ // Build the file URL
+ String fileURL=baseDirM+fs+"test-resources"+fs+"java2sec"+fs+fileName;
+ Permission perm = new java.io.FilePermission(fileURL, "read");
+ acc.checkPermission(perm);
+ // Demostrate the usage of AccessController's doPrivilege(PrivilegeAction action, AccessContext ctx)
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ _actor.takeAction();
+ return null;
+ }
+ }, acc);
+ }
+ else {
+ // Use no doPrivileged
+ _actor.takeAction();
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionAccessControlContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionPrivilegedExceptionAction.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionPrivilegedExceptionAction.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionPrivilegedExceptionAction.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionPrivilegedExceptionAction.java Sun Feb 25 11:56:59 2007
@@ -1,62 +1,62 @@
-/*
- * Copyright 2006 International Business Machines Corp.
- *
- * 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.apache.axis2.java.security.more;
-
-import org.apache.axis2.java.security.AccessController;
-import org.apache.axis2.java.security.interf.Actor;
-
-import java.security.PrivilegedExceptionAction;
-
-/**
- * MorePermission has read permission to both public.txt and private.txt
- */
-
-public class MorePermissionPrivilegedExceptionAction implements Actor {
-
- private Actor _actor;
- private boolean _usingDoPrivilege;
-
- // Constructor
- public MorePermissionPrivilegedExceptionAction(Actor a, boolean usingDoPrivilege) {
- _actor = a;
- _usingDoPrivilege = usingDoPrivilege;
-
- }
-
- // Implementing Actor's takeAction method
- public void takeAction() {
- try {
- if (_usingDoPrivilege) {
- // Demostrate the usage of AccessController.doPrivileged(PrivilegedExceptionAction action)
- AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Object run() {
- _actor.takeAction();
- return null;
- }
- });
- }
- else {
- // Use no doPrivilege
- _actor.takeAction();
- }
- } catch (Exception e) {
- e.printStackTrace(System.out);
- }
- }
-}
-
+/*
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.apache.axis2.java.security.more;
+
+import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.java.security.interf.Actor;
+
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * MorePermission has read permission to both public.txt and private.txt
+ */
+
+public class MorePermissionPrivilegedExceptionAction implements Actor {
+
+ private Actor _actor;
+ private boolean _usingDoPrivilege;
+
+ // Constructor
+ public MorePermissionPrivilegedExceptionAction(Actor a, boolean usingDoPrivilege) {
+ _actor = a;
+ _usingDoPrivilege = usingDoPrivilege;
+
+ }
+
+ // Implementing Actor's takeAction method
+ public void takeAction() {
+ try {
+ if (_usingDoPrivilege) {
+ // Demostrate the usage of AccessController.doPrivileged(PrivilegedExceptionAction action)
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction() {
+ public Object run() {
+ _actor.takeAction();
+ return null;
+ }
+ });
+ }
+ else {
+ // Use no doPrivilege
+ _actor.takeAction();
+ }
+ } catch (Exception e) {
+ e.printStackTrace(System.out);
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/java/security/more/MorePermissionPrivilegedExceptionAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/BeforeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/BeforeTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/BeforeTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/BeforeTest.java Sun Feb 25 11:56:59 2007
@@ -19,8 +19,8 @@
import junit.framework.TestCase;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.ContextFactory;
+import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.HandlerDescription;
import org.apache.axis2.description.PhaseRule;
import org.apache.axis2.engine.AxisConfiguration;
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/PhaseRuleHandlers.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/PhaseRuleHandlers.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/PhaseRuleHandlers.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/phaserule/PhaseRuleHandlers.java Sun Feb 25 11:56:59 2007
@@ -30,7 +30,7 @@
private static final long serialVersionUID = 2941436920684525811L;
- private static final Log log = LogFactory.getLog(PhaseRuleHandlers.class);
+ private static final Log log = LogFactory.getLog(PhaseRuleHandlers.class);
private QName name;
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/echo/EchoImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/echo/EchoImpl.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/echo/EchoImpl.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/echo/EchoImpl.java Sun Feb 25 11:56:59 2007
@@ -17,11 +17,11 @@
package org.apache.axis2.sample.echo;
public class EchoImpl {
- public EchoImpl(){}
- public java.lang.String echoString(java.lang.String in) {
- return in;
- }
- public java.lang.String[] echoStringArray(java.lang.String[] in) {
- return in;
- }
+ public EchoImpl(){}
+ public java.lang.String echoString(java.lang.String in) {
+ return in;
+ }
+ public java.lang.String[] echoStringArray(java.lang.String[] in) {
+ return in;
+ }
}
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/handlers/LoggingHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/handlers/LoggingHandler.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/handlers/LoggingHandler.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/sample/handlers/LoggingHandler.java Sun Feb 25 11:56:59 2007
@@ -26,7 +26,7 @@
private static final long serialVersionUID = 7656851260678664746L;
- private static final Log log = LogFactory.getLog(LoggingHandler.class);
+ private static final Log log = LogFactory.getLog(LoggingHandler.class);
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
log.info("Incoming message From " + msgContext.getTo().getAddress());
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/util/SchemaUtilTest.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org