javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/utils/CmdLineArgsPermission.java
changeset 35 85266cc22c7f
child 64 0ea12c182930
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/utils/CmdLineArgsPermission.java	Fri Jun 11 13:33:44 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Permission object for managing access to command line API feature
+*
+*/
+
+
+
+package com.nokia.mj.impl.rt.utils;
+
+import java.security.Permission;
+import java.security.PermissionCollection;
+import com.nokia.mj.impl.security.common.PermissionBase;
+import com.nokia.mj.impl.security.utils.SecurityPromptMessage;
+
+/**
+ * Permission class representing the token access to command line API feature.
+ *
+ */
+public class CmdLineArgsPermission extends PermissionBase
+{
+    /**
+     * Constructor
+     *
+     */
+    public CmdLineArgsPermission()
+    {
+        super(null);
+    }
+
+    /**
+     * Returns the question (as localized text) associated with the security
+     * prompt
+     *
+     * @return the localized text associated with the security prompt
+     */
+    public String getSecurityPromptQuestion(int aInteractionMode)
+    {
+        return (SecurityPromptMessage.getInstance()).getText(
+            SecurityPromptMessage.QUESTION_ID_APP_AUTO_LAUNCH,
+            null);
+    }
+
+    /**
+     * Only implies permission objects of same instance
+     */
+    public boolean implies(Permission p)
+    {
+        if (p instanceof CmdLineArgsPermission)
+        {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * String representation of the permission
+     */
+    public String toString()
+    {
+        return "com.nokia.webstart";
+    }
+    
+    /**
+     * Don't allow cloning
+     */
+    public boolean equals(Object obj)
+    {
+        return (obj.hashCode() == hashCode());
+    }
+
+    /**
+     * Not supported
+     */
+    public int hashCode()
+    {
+        return 0;
+    }
+
+    /**
+     * Actions are not supported
+     */
+    public String getActions()
+    {
+        return null;
+    }
+
+    /**
+     * Permission collections not supported
+     */
+    public PermissionCollection newPermissionCollection()
+    {
+        return null;
+    }
+}
\ No newline at end of file