Including non-existent permissions in a policy file

I noticed that if I, in a policy file, specify a permission which implementation is not available to the VM, no error occurs and it seems like the bogus permission is simply ignored.
I use -Djava.security.manager and -Djava.security.policy=my.policy.
For example, if I specify a permission that was added in J2SE 5.0 in a policy file used with a J2SE 1.4.2 JVM (from Sun), I get no errors. This is good, since it means that I can use the same policy file for all JVM versions that I have to support. However, I was not able to find anything about this in the documentation.
Can I trust all compliant JVMs to work like this, or is this specific to Sun's implementations? Is this mentioned in the documentation/spec somewhere?
Thanks...

if you want to give read permissions for all the files in conf:
permission java.io.FilePermission "\\dvp\\conf\\-","read";
Hope this help!

Similar Messages

  • RequestDispatcher.include() silently ignores non-existent files?

              Hello there,
              I have a servlet that calls RequestDispatcher.include() to include another jsp.
              <pre>
              RequestDispatcher dispatcher = myServlet
              .getServletConfig().getServletContext()
              .getRequestDispatcher(jspName);
              // dispatch the jsp
              dispatcher.include(fRequest, fResponse);
              </pre>
              However, if the JSP is non-existent (not found in the file system), I get no exceptions
              and WL6.1sp2 seems to silently ignore it. I also do not see any errors in the WL
              log files. If the JSP does exist, then it loads up, and then if I subsequently
              delete it, I get an Exception as expected.
              Can anyone help with this? Is this a bug? Any help is appreciated!
              Thanks
              ravi
              SP - Please remove the 2 "##NO_SPAM##" strings in my address before replying, thanks!
              

    Check if SUNWhea (SunOS header files) package is in fact installed on your Solaris 9 machine.

  • Custom WS-Policy Files in Console Service Endpoint Polices List

    hi
    Not sure which WLS newsgroup for this so here goes.
    I want to assign custom WS-Policy files to a web service via the console (i.e. post-deployment).
    By default, the Service Endpoint Policies list only shows a small subset of default policy files within weblogic.jar and none of the Wssp1.2-* policy files. (i.e. only the proprietary WLS 9.0 WS-Policy files)
    Is this correct behaviour? I want to experiment with policies based on the current WS Security Policy Standard without hard-coding the names of files into the service.
    Is there a way to make these other supplied WSSecurityPolicy 1.2 policies appear in the list?
    Thanks
    Jim Nicolson

    Hi,
    Below are the steps followed
    - OSB Proxy service has 'oracle/wss_username_token_service_policy' attached to it.
    - Iam invoking this from BPEL. BPEL process has 'oracle/wss_username_token_client_policy' attached.
    - I can invoke the osb proxy from bpel by passing credentials - No Issues.
    Now I need to put some authorization restriction to the proxy service, so only specific users can access that.
    -I used Role=Admin as a policy condition restriction under security in Proxy service.
    -Then I went to proxy test console and I added the 'oracle/wss_username_token_client_policy' credentials and weblogic/xxxxx at Transport section and I was able to invoke the process. Here weblogic has a Admin Role.
    -I cannot invoke the same proxy service from BPEL in Jdeveloper now.
    All Iam trying to do is to protect my proxy by authrorization policy.
    Thanks
    Jagan.

  • Granting different permissions to different codebases : policy file problem

    Hi all. I'm having a bit of a problem with policy files and granting different persmissions to different codebases. What I have at the moment is a server app that copies a class file from the client to a specified directory on the server, and then dynamically loads and runs that class. This all works fine, but obviously as user submitted code is going to be run on the server I want to restrict what they are allowed to do. My app is going to be bundled up in a single jar file, and the directory that the client code is being copied to a subdirectory of the app installtion (not that this should make much difference). What i want to do is grant all permissions to my code in the jar file and resrict the permssions granted to code in the strategies directory. I assumed i would just be able to do this using my own policy file, but at the moment i'm not having much luck.
    Directory structure:
    c:/project/code/
    |
    |-labyrinth.jar
    |-strategies/
    Contents of labyrinth.policy:
    grant codeBase "file:../code/labyrinth.jar" {
    permission java.security.AllPermission;
    Command line arguments:
    java -Djava.security.manager -Djava.security.policy==./labyrinth.policy -classpath .;./labyrinth.jar;./strategies/;%CLASSPATH%; labyrinth.LabyrinthServer
    I've tried specifiying the absolute path to the jar file in the policy file as well as the relative path, i've tried including -Xbootclasspath/a and appending the jar file. All I seem to be able to manage though is either granting all permissions system wide, including the strategies dir, or none and getting security exceptions within my code. Anyone tried doing anything similair or got any idea where I might be going wrong? Any help would be appreciated as its really starting to doing my head in.
    TIA. Matt.

    Did you try putting a slash at the beginning of your "file" specification? e.g., instead of saying
    grant codeBase "file:../code/labyrinth.jar" {
    permission java.security.AllPermission;
    say
    grant codeBase "file:/../code/labyrinth.jar" {
    permission java.security.AllPermission;
    Hope this helps.

  • HELP: How do i include a policy file when embedding a JApplet

    This is the problem i'm facing.I've been able to successfully grant my japplet permission to access resources on the c: drive. When i run it using appletviewer there's no problem, it's able to access the database on the c: drive but when i embedd it in my html page it fails to access the database (i.e it is unable to include the policy file). Does anyone know how to get around this problem?

    You can not directly include a policy within an applet. This would be a security risk.
    In general you have 2 choices if you wish to grant an applet more rights than it has per default:
    1. You can sign it.
    2. You change your local policy file.
    ad 1:
    You can generate a keypair using keytool and sign the applet with jarsigner. (you need to create a jar file first)
    when your applet is then loaded in the browser, a popup asks the user, if he wanna trust the signer. If the user clicks no, the applet is executed with standard applet rights. If the user clicks yes, the applet is executed with full permission (like an applet from file:/*)
    ad 2:
    use policytool to create/change a policy file in your home directory. You can describe the applet either with a path (=codebase) or with some meta-information like signer.
    create a policy that fits your need, and save the file.
    next time you execute your applet in the browser, the policy will grant the applet additional permissions.
    There is a third option. You can mix 1 and 2.
    You can sign your applet, and create a policy for all applets signed by you.
    Then there will be no popup, and the applet has automatically the rights you defined in the policy file.
    But I would suggest to consider the possibility to write a stand-alone application, instead of granting an applet access to the local hard disk.

  • My laptop was stolen and with it my itunes, all of my music (including non-apple downloaded content) is still on my iphone 5, how can I transfer the files to my new laptop which is authorised to the same apple ID?

    my laptop was stolen and with it my itunes, all of my music (including non-apple downloaded content) is still on my iphone 5, how can I transfer the files to my new laptop which is authorised to the same apple ID?

    See this user tip for recovering the media from the iPhone: https://discussions.apple.com/docs/DOC-3991

  • How do I find and include pre-existing music files on my PC?

    I'm new to iTunes and believe that I should be able to find and include pre-existing music files on my PC?
    I've found out how to show the menu bar but I can't see how to do the above except file/folder by file/folder.

    Hello there, LeighCenturion.
    The following Knowledge Base article provides instruction on how to add content from your computer to iTunes:
    Adding music and other content to iTunes
    http://support.apple.com/kb/HT1473#2
    Specifically:                     
    Adding content on your computer to iTunes
    iTunes helps you add digital audio and video files on your computer directly to your iTunes library. You can add audio files that are in AAC, MP3, WAV, AIFF, Apple Lossless, or Audible.com (.aa) format. If you have unprotected WMA content, iTunes for Windows can convert these files to one of these formats. You can also add video content in QuickTime or MPEG-4 format to iTunes. To learn how to add these files to iTunes follow the steps below.
    Open iTunes
    From the File menu, choose one of the following choices:
    MacAdd to Library
    Windows
    Add File to Library
    Add Folder to Library
    Navigate to and select the file or folder that you want to add
    If iTunes is set to "Copy files to the iTunes Music folder when adding to library," iTunes will copy all content that is added to the iTunes library to the iTunes Music folder. To adjust this setting or change the location of this folder, go to the Advanced tab in iTunes Preferences.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • DBMS_LOB.FILEOPEN(dir, fname) gives non-existent dir or file error

    Hello!
    I've been trying to load an image file into the oracle database using the DBMS_LOB loadfromfile procedure. In order to do this, I first have to open the appropriate file which I do using
    temp_bfile := bfilename('temp_dir', in_filename);
    where in_filename is a string having the appropriate filename. and 'temp_dir' is a directory object created as follows:
    CREATE DIRECTORY temp_dir AS 'F:\';
    Next when I do a
    DBMS_LOB.FILEOPEN(temp_bfile, LOB_READONLY);
    I get an exception ORA-22285:non-existent directory or file.
    What am I doing wrong? Is the way I've created the directory object correct. I work on an NT machine.
    Mona

    Not sure if the UTL_FILE package is the same but if you don't set the "utl_file_dir" variable in the INIT.ORA file prior to calling the FOPEN procedure you will get a similiar error. There may be an equivalent parameter for the DBMS_LOB package.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Mona Marathe ([email protected]):
    Hello!
    I've been trying to load an image file into the oracle database using the DBMS_LOB loadfromfile procedure. In order to do this, I first have to open the appropriate file which I do using
    temp_bfile := bfilename('temp_dir', in_filename);
    where in_filename is a string having the appropriate filename. and 'temp_dir' is a directory object created as follows:
    CREATE DIRECTORY temp_dir AS 'F:\';
    Next when I do a
    DBMS_LOB.FILEOPEN(temp_bfile, LOB_READONLY);
    I get an exception ORA-22285:non-existent directory or file.
    What am I doing wrong? Is the way I've created the directory object correct. I work on an NT machine.
    Mona<HR></BLOCKQUOTE>
    null

  • Scan From File aborts the calling VI if it is pointed to a non-existing file

    The Scan From File primitive throws an error dialog and aborts the VI if it's given a non-existing file instead of returning an error in its output. See attached example (8.6).
    Try to take over the world!
    Attachments:
    Scan from file bug.vi ‏7 KB

    Anna K. wrote:
    Please let me know if you need assistance in working around this bug.
    For anyone wondering, the workaround is simply to check if the file exists before trying to read it. You can do this by calling the File/Directory Info primitive and checking the error output. Or you can use the OpenG File Exists? VI.
    I'm assuming this primitive is used rarely, if at all, which is why no one ever reported this. I had it in an old piece of temporary utility code which was moved elsewhere. It had a hardcoded path and when I ran it again a year or so after last using it, I ran into this. The only reason I used the primitive in the first place was because I wanted a quick way to save a number in a file and read it back. I never used it in any real code.
    Anna, I don't personally care, but what's the CAR number? Some people do seem to want to know them.
    Try to take over the world!

  • ORA-22285 - non-existent directory or file for FILEOPEN operation

    Hello
    I want to insert the xmldata from a xmlfile to the a table, with this scirpt:
    #!/bin/sh
    set -x
    for i in `find . -name "dspevent*.xml"| awk -F"/" '{print $NF}'`
    do
    echo $i
    fname_old=$i
    fname_neu=`ls $i | awk '{print "OK_"$0}'`
    cat $i | sed 's/aps://g' >$fname_neu
    echo $fname_neu
    rm $i
    #insert_xml $fname_neu
    INSERT_XML=`sqlplus -s username/passwort@database <<EOF
    INSERT INTO event_xml (name,
    dtsysl,
    hrsysl,
    dtcptl,
    nusesi,
    dsp_step,
    dsp_state,
    bat_class,
    bat_program,
    bat_seqi,
    bat_state)
    SELECT *
    FROM XMLTABLE (
    'Operations/Event'
    PASSING xmltype (BFILENAME ('EVENT_DIR', '$fname_neu'),
    NLS_CHARSET_ID ('CHAR_CS'))
    COLUMNS name VARCHAR (40) PATH 'name',
    dtsysl DATE PATH 'dtsysl',
    hrsysl NUMBER PATH 'hrsysl',
    dtcptl DATE PATH 'dtcptl',
    nusesi NUMBER PATH 'nusesi',
    dsp_step VARCHAR (40) PATH 'DSP/step',
    dsp_state VARCHAR (40) PATH 'DSP/state',
    bat_class VARCHAR (40) PATH 'BAT/class',
    bat_program VARCHAR (40) PATH 'BAT/program',
    bat_seqi NUMBER PATH 'BAT/seqi',
    bat_state VARCHAR (40) PATH 'BAT/state');
    EOF
    `
    done
    But the problem is, that I have always this error message:
    ORA-22285 -> non-existent directory or file for FILEOPEN operation
    I'd create a direcotrie and over utl_file.fopen I can write a file to this directorie, but this works over the path, not over the directory name. the utl_file_dir parameter was also set to the correct path. Whats wrong or how can I debug this problem?
    thanks.
    roger

    - the name of the directory is correct.
    - how can I check, that the user can use the directory?
    - in this logfile you can see that, the file name will replace correctly:
    ./dspevent.sh
    + awk -F/ {print $NF}
    + find . -name dspevent*.xml
    + echo dspevent_db_20110503030448_10641.xml
    dspevent_db_20110503030448_10641.xml
    fname_old=dspevent_db_20110503030448_10641.xml
    + awk {print "OK_"$0}
    + ls dspevent_db_20110503030448_10641.xml
    fname_neu=OK_dspevent_db_20110503030448_10641.xml
    + sed s/aps://g
    + cat dspevent_db_20110503030448_10641.xml
    + echo OK_dspevent_db_20110503030448_10641.xml
    OK_dspevent_db_20110503030448_10641.xml
    + rm dspevent_db_20110503030448_10641.xml
    + sqlplus -s username/passwort@db
    INSERT INTO event_xml (name,
    dtsysl,
    hrsysl,
    dtcptl,
    nusesi,
    dsp_step,
    dsp_state,
    bat_class,
    bat_program,
    bat_seqi,
    bat_state)
    SELECT *
    FROM XMLTABLE (
    'Operations/Event'
    PASSING xmltype (BFILENAME ('EVENT_DIR', 'OK_dspevent_db_20110503030448_10641.xml'),
    NLS_CHARSET_ID ('CHAR_CS'))
    COLUMNS name VARCHAR (40) PATH 'name',
    dtsysl DATE PATH 'dtsysl',
    hrsysl NUMBER PATH 'hrsysl',
    dtcptl DATE PATH 'dtcptl',
    nusesi NUMBER PATH 'nusesi',
    dsp_step VARCHAR (40) PATH 'DSP/step',
    dsp_state VARCHAR (40) PATH 'DSP/state',
    bat_class VARCHAR (40) PATH 'BAT/class',
    bat_program VARCHAR (40) PATH 'BAT/program',
    bat_seqi NUMBER PATH 'BAT/seqi',
    bat_state VARCHAR (40) PATH 'BAT/state');
    INSERT_XML= PASSING xmltype (BFILENAME ('EVENT_DIR', 'OK_dspevent_db_20110503030448_10641.xml'),
    ERROR at line 15:
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.XMLTYPE", line 296
    ORA-06512: at line 1
    + echo dspevent_db_20110502190712_10641.xml
    dspevent_db_20110502190712_10641.xml

  • Problem with granting permissions in the security policy file

    Hi,
    I have a security policy file. I am granting permissions to some files. Now even if I have given permissions explicitly it doesnt taking it and gives error. My code snippet is as follows:
    grant codeBase "file:${jboss.server.home.dir}/deploy/jboss-ws4ee.sar/-"{
         permission java.security.AllPermission;
    The stack-trace for the same is as follows:
    11:09:49,518 ERROR [MainDeployer] Could not initialise deployment: file:/C:/Java/jboss-4.0.2/server/all/deploy/jboss-ws4ee.sar/jboss-ws4ee.war
    java.security.AccessControlException: access denied (java.io.FilePermission C:\Java\jboss-4.0.2\server\all\tmp\deploy\tmp17221jboss-ws4ee.war read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
         at java.io.File.lastModified(File.java:771)
         at org.jboss.deployment.MainDeployer.init(MainDeployer.java:866)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:765)
         at org.jboss.deployment.MainDeployer.addDeployer(MainDeployer.java:360)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy37.addDeployer(Unknown Source)
         at org.jboss.deployment.SubDeployerSupport.startService(SubDeployerSupport.java:111)
         at org.jboss.web.AbstractWebContainer.startService(AbstractWebContainer.java:600)
         at org.jboss.web.tomcat.tc5.Tomcat5.startService(Tomcat5.java:409)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:418)
         at org.jboss.system.ServiceController.start(ServiceController.java:440)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
         at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy8.deploy(Unknown Source)
         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy
    Here I am giving all permission which in turn encapsulate FilePermission also. So this should work. But why it is bypassing this permission?
    Any clues?!
    Thanks.
    Jahnvi

    grant codeBase
    "file:${jboss.server.home.dir}/deploy/jboss-ws4ee.sar/-"{That's not a codebase, it's a specification for a FilePermission. A codebase is a list of one or more directories or JAR files expressed as URLs.

  • AppleScript - Writing to non-existent directories, and non-existent files..

    All,
    AppleScript - Writing to non-existent directories, and non-existent files...
    Creating directories several levels deep on the fly.
    How do we write to a file that does not exist, buried deep down in a hierarchy of directories that don't exist either...
    In trying to do this I explored two options. One used AppleScript, assisted by UNIX, which was simplicity itself, the other one used only AppleScript and was considerably more complex, and slower.
    http://www.mac-specialist.com/r/asckdirs.html
    Hope these are useful,
    Best Regards,
    Bill Hernandez
    Plano, Texas

    Simplified code examples - lacking extensive error checking -
    UNIX example 001:
    set file_Name to "Sales Figures.txt" -- File to create.
    set file_Path to "2006 Sales:Forecast:Fruits:Flordia:Oranges:Large" -- Folder to create.
    set UNIXfilePath to (quoted form of (POSIX path of file_Path))
    try
    do shell script "mkdir -p " & UNIXfilePath -- Attempt to create a folde, and respective intermediary folder(s).
    end try
    try
    do shell script "touch " & UNIXfilePath & "/" & file_Name -- Attempt to create a blank file.
    end try
    UNIX example 002:
    set file_Name to "Sales Figures.txt" -- File to create.
    set file_Path to "2006 Sales:Forecast:Fruits:Flordia:Oranges:Large" -- Folder to create.
    try
    do shell script "mkdir -p " & (quoted form of (POSIX path of file_Path)) -- Attempt to create a folde, and respective intermediary folder(s).
    end try
    -- Create a file, and enter some text.
    set FREF to open for access file (file_Path & ":" & file_Name) with write permission
    write "Beispieltext" to FREF
    close access FREF
    AppleScript example:
    set file_Name to "Sales Figures.txt" -- File to create.
    set file_Path to "2006 Sales:Forecast:Fruits:Flordia:Oranges:Large" -- Folder to create.
    -- Obtain list of text items of 'file_Path'.
    set {oAStID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
    set filePathList to text items of file_Path
    set AppleScript's text item delimiters to oAStID
    tell application "Finder"
    set folder_Path to name of startup disk -- Obtain name of boot disk.
    repeat with i in filePathList -- Cycle through list.
    try
    make new folder at folder_Path with properties {name:i} -- create folder.
    set folder_Path to folder_Path & ":" & i -- Create new path for next new folder.
    end try
    end repeat
    end tell
    -- Create a file, and enter some text.
    set FREF to open for access file (folder_Path & ":" & file_Name) with write permission
    write "Beispieltext" to FREF
    close access FREF
      Mac OS X (10.4.4)  

  • Help with which permissions to go into policy file

    I posted this question in Java Web Start & JNLP forum, but realize it may be more appropriate here.
    I am writing my first policy file. I am trying to devise a "system" whereby the users/developers within my organization can use Java Web Start to access each other's applications from our intranet. Previously we were either copying the applications and running them locally or else mapping network drives, but they were running from command line (with no sandbox issues?) either way.
    The application that I am testing Java Web Start with tries to make a database connection. Even with my jarfile signed and my application requesting "all-permissions" and the user granting the permission when prompted, the database connection was always failing. I started looking into the solution of having each user (within my organization) append some "grants" into their user policy file.
    Since these users have already been "trusting" each other's programs enough to run them from the command line, they wouldn't mind an "automatically" having the same level of trust via JWS. But I don't know enough about permissions to know how to specify the correct permissions and know that I am not dangerously widening the permissions.
    How do I write grant clauses into a policy file that say "anything run from our intranet web server can do anything a command-line program could do" ? I tried this:
    grant codeBase "http://our_intranet_webserver/-" {
      permission java.security.AllPermission;
    };...but the database connection still fails. But when I add this:
    grant codeBase "file:/C:/Program Files/Java Web Start/-"{
      permission java.net.SocketPermission "*", "connect";
    (the codebase would refer to the local Java Web Start program itself)...the database connection succeeds. (When I replace SocketPermission with AllPermission, the connection fails. I don't understand that.) BUT if I go granting general permissions to Java Web Start, wouldn't that grant apply to every Java-Web-Start-deployed application on the Web, not just our stuff?
    Thanks for any help or advice on the matter,
    /Mel

    (When I replace SocketPermission with AllPermission, the connection fails. I don't
    understand that.) This problem is solved. It is not true. I currently have a policy file that says:
    grant codeBase "http://our_intranet_webserver/-" {
      permission java.security.AllPermission;
    grant codeBase "file:/C:/Program Files/Java Web Start/-"{
      permission java.security.AllPermission;
    };and the db connection does not fail. If I remove the first grant clause, leaving only AllPermissions to Java Web Start, the db connection does not fail.
    BUT if I go granting general permissions to Java Web Start, wouldn't that grant apply to
    every Java-Web-Start-deployed application on the Web, not just our stuff?This is still my problem. Why should I have to grant Java Web Start permissions (regardless of all or some) when I only want to grant them to a subset of codebases from which Java Web Start can run programs (specifically our intranet webserver)? I think this question has gone back to being more appropriate for the JWS Forum.
    Thank you,
    /Mel

  • HT3231 I tried to migrate information from MacBook Air to ...Pro and it seemed to have taken files from folders on desktop as none exist on Air now.  As to where these files are, I don't know.  It has also taken my pictures from iPhoto to unknown destinat

    I tried to migrate information from MacBook Air to ...Pro and it seemed to have taken files from folders on desktop as none exist on Air now.  As to where these files are, I don't know.  It has also taken my pictures from iPhoto to unknown destination. ??

    If you used migration assistant then it probably created a new Login user and placed the migrated files under it.
    Regards,
    Captfred

  • Saving a file to a non-existing directory

    Hello all,
    I would like to know if it is possible to save a file to a non-existing directory using Java. I have a bad feeling that it's not possible, but if there is anyone out there who thinks otherwise, please tell me how it can be done.
    Thanks very much!
    Greetz Hans

    Hi,
    Of course you can create all you want.
    Try
              File fichier = new File(chemin);
              if ( ! fichier.exists()) {
                   // the path doesn't exist
                   ok = fichier.mkdirs();
    The mkdirs (with the s) can create the path in a recursive mode. See the File object's help
    Regards, JFB

Maybe you are looking for