How to access a file via Applet and JavaScript

I want to copy one file on the client machine from one place to another place from a Java Bean.
To do this I created an applet and a Java Bean as follows:
import java.applet.*;
public class FileUtils extends Applet {
    public void copyFile(String src, String dest)  {
    private String source, destination; // setters/getters are there of course
    public void copyFile(ActionEvent actionEvent) { // Bean
        FacesContext fctx = FacesContext.getCurrentInstance();
        ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
        String command = "var s = '"+ source +"'; var d ='" + destination +"'; " +  " document.fileUtilsApplet.copyFile(s, d); ";
        erks.addScript(fctx, command);
    }Then I added the APPLET tag referencing the above class in the page fragment:
                <f:verbatim>
                    <applet code="FileUtils.class" name="fileUtilsApplet" height="30"
                            archive="/context-root/Applet.jar"
                            width="200">
                    </applet>
                </f:verbatim>From the Java console I can see the jar is successfully downloaded, but when the code in the bean is executed, the JavaScript code does not seem to do anything, as if the "copyFile" public method was not called at all and no output in the Java Console as well.
Note that I already followed the guidelines at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/71-adf-to-applet-communication-307672.pdf .
Do you have any ideas?

Ok, I can see the permission problem now:
java.security.AccessControlException: access denied (java.io.FilePermission c:\myfile.txt read)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkRead(Unknown Source)
     at java.io.FileInputStream.<init>(Unknown Source)
Edited by: user10047839 on 1-feb-2013 7.29
signing the Jar and downloading the certificate permanently does not change anything in Firefox. The Java console keeps giving the above exception.
Any idea?

Similar Messages

  • How to access a file using Applet?

    Dear all,
    I would like to use an applet to read and display information on server side, but there still a fileaccess permission denied, what can i do?
    The idea of the web service is like that::
    1.User connected to a webpage, than they can choose the file and then,
    2. the file name will be transfered into the applet (using applet><param> tags etc.)
    3. THe applet read and displays information.
    In addition, the file is placed at server side, should I set the "./hotjava/ properties "

    Maybe you should sign your applet.
    You'll find further information in the Signed Applets Forum:
    http://forum.java.sun.com/forum.jspa?forumID=63

  • How to access host files?

    how to access host files?

    Easy and not depends on your software version:
    press Shift+cmd+G while your finder window is open and active, you will get a new window with the field where you can write /etc/hosts
    Anyway to edit hosts file you should open it with the sudo command, this can be done in terminal window, not in Finder. Also easy and can be done next way:
    press Shift+Cmd+U while Finder window is open and active, then choose Terminal.app, and after it opens enter sudo nano /etc/hosts. You will be asked for password - this is the password you enter then you installing new application. You should know few commands to edit your hosts file:
    Previoius page/Next Page of the file - Ctrl+Y/Ctrl+V
    Add record - Input the text you need on the last free line of the file and then press Ctrl+O
    Delete record - put cursor on the line you want to delete and press Ctrl+K
    Undo - Ctrl+U
    Exit - Ctrl+X
    After edit your hosts file you should update DNS records - in terminal window enter the command dscacheutil -flushcache
    But if you really don't know what are you doing, my advice is do not touch your hosts file, ask for professional to do his job. Just like I'm doing usually. )))

  • I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files?

    I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files? Does using time machine mean that that partition is no longer able to be used as it used to be?
    HDD is a Toshiba 1TB, partitioned into two 500GB partitions.
    OS X version 10.9.2

    Yes, sharing a TM disk is a bad idea, and disks are cheap enough so that you don't need to.
    Now
    Have you tried to repair the disk yet

  • HT1145 I can't see my files on my USB shared drive.  It shows there is lots of space taken up, but I can't access the files via my Mac.

    I can't see my files on my USB shared drive.  It shows there is lots of space taken up, but I can't access the files via my Mac.  How do I see them?  I also can't see them on my iPad using FileBrowser.

    You don't have access to it to configure it via Time Machine? You lost me on that one, Time Machine is used for Backup.
    Here is a basic article on the first setup and what you should see:
    http://support.apple.com/kb/HT1178
    To configure Time Capsule you should be using "Airport Utility" 5.3 or higher that is located in the Utilities folder. You can tell if its version 5.3 because the icon will have blue lines instead of orange lines like the older versions. Since you are running Leopard 10.5.6 and you ran Software Update you are probably already running the latest 5.3 version.
    The light flashing amber means you haven't entered enough information so that it can get to the internet. Once you have that info entered the light will turn green.
    If your absolutely sure your CAT5 cables are good you can try a hard reset. I think you have to push the reset button on the back and hold it for 5 seconds or so until the amber light blinks rapidly, then when you release the button it does the reset then.
    http://support.apple.com/kb/HT1300?locale=en_US
    Hope this helps! If not I would probably call AppleCare support or see if you can exchange it.
    -Dan

  • Access a file using applets

    hello friends,
    i'm trying to access a file using applets but i'm getting security error.
    similar error for accessing the data base also so pls if you know help me how to access file/database using applets.

    You need to use a signed applet and know where the file is and in an accessable area; signing an applet will not allow you to go on a "fishing expedition" through the file system.

  • I have a  new iMac   cannot find how to access my files in Dreamweaver

    I cannot find how to access my files,  as I am now using Yosemite and it is all a different layout .
    can anyone get me started please
    Clicking on the cloud icon is no help

    Copy the entire /Music/iTunes folder to /Music/ on the new computer.
    That is all you need to do.

  • How to access xml file using c

    how to access xml file using c. are there any libraries regarding xml fastinfoset in c? Please let me know about any resources if u know? thanks!!!
    samitha

    There are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.

  • I wanted to know how does technical support work via icloud and is there any new technology out that helps providing technical support

    i wanted to know how does technical support work via icloud and is there any new technology out that helps providing technical support?

    basically I’m doing a project were I wanted to find out if there are recent technology  out that provides technical support for example they do it with remote access but is they any new ways that  they can support us and just wanted to find out if icloud gives technical support then how?

  • How can I send files via Bluetook from my Tour to other phones?

    How can I send files via Bluetook from my Tour to other phones?
    I have even been able to pair to the other device, but I don't see the option to send/copy/move files through Bluetooth.
    I can only send my Address book via bluetooth.
    Please help!!

    Hi and Welcome to the Community!
    See this KB:
    KB05409 Transfer a file using Bluetooth technology between two BlackBerry smartphones
    Substitute, in the KB, the appropriate instructions for your other device in place of the KB section for the receiving device. Be aware that RIM only supports BT file transfer between BBs...with other devices is technically unsupported. But, it usually works, as long as the two devices are paired, trusted to each other, and each have all of the correct BT services enabled for the configuration of the other device.
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • C5-03 -how to send music files via bluetooth

    hi
    i've c5-03 mobile
    1.can any one tell me how to send music files via bluetooth
    2.there only mark all option ann no mark several option can any one tell me r there any software updates for this
    Solved!
    Go to Solution.

    PerLs wrote:
    Hi,
    You can do it with the file manager this is how i use to do it. You will find it in menu|applications|office folder
    There is also a possibility to long press on the track and send. Im not sure if C5-03 support this... But go to you music libery and find the track you want then long press on it and press send.the long press method works
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • I cleared a playlist on my iPhone 4 because I wanted to remove the songs from my phone's storage (I had previously downloaded them) because I wanted to clear storage space. I now want to access the playlist via iCloud and can't. Thoughts?

    I cleared a playlist on my iPhone 4 because I wanted to remove the songs from my phone's storage (I had previously downloaded them) because I wanted to clear storage space. I now want to access the playlist via iCloud and can't. In other words, I want it to sync with the playlist as it exists in iTunes Match. Thoughts?

    Export Photos and Videos from Camera Roll to your computer.
    Empty Camera Roll.
    Make a Folder/Album with all photos and videos you want to have in your iPhone and sync them through iTunes.
    This will free up space in your iPhone and your iCloud.
    The backup of Camera Roll in iCloud is only to restore your iPhone. You can't access them directly.

  • How to access pdf files on icloud with iphone

    Does anyone know how to access pdf files on icloud when saved to icloud on a mac?

    At the moment, you can't.  A favourite complaint.  Hopefully, the situation will change in the near future, but only Apple knows when or if.

Maybe you are looking for