How can I rewrite the java.io.file class to a custom file class?

Hi All!
Im new to Java. Well, I did some experiments with small Applets. Because it is not allowed to use Files in an unsigned Applet, I need to know, how I can manage to overwrite the java.io.File class. The background: I have to port some Applications which need file access into Applets.
I think it is necessary to create a class with the same signature then the Java.io.File that stores the information in an database on the Webserver or read information from there. Then overload the java.io.File with my custom file class.
Is this possible and, if so, how?
Thanks!

Hi yawmark !
Thanks for the quick answer! My idea to store the filecontent into a database is caused by the plan to make the application-port independent from the workstation executing it. So it would be a nice feature storing the "files" into a database.
JavaBeginner2009

Similar Messages

  • How can I put the report generated by a program into a File?

    Hi all,
       How can I put the report generated by a program into a File?It can be in TXT format or excel format which ever is possible.
    I need to export this file to memory,How can I do that??
    Regards,
    Shashank.

    Hello Shashank,
    Please ignore my previous answer... Ofcourse it works...
    There are several ways to do this...
    two of them are
    1. List -> Save -> File and press enter..
        it will ask for the format, then path where to save it. Just give the path.
    2. Using function module 'GUI_DOWNLOAD'.
    I'm giving the example bellow which explains the usage of both GUI_UPLOAD and GUI_DOWNLOAD.
    To do this... you need to have folder with name 'TEST' and a .txt file in it with name 'test'. And contents of it are :
    TEST1             ,BOT 
    TEST2             ,BOT 
    TEST3             ,BUT 
    with spaces.
    REPORT zssr_bdc .
    DATA: BEGIN OF g_t_itab OCCURS 0,
            matnr LIKE mara-matnr,
            maktx LIKE makt-maktx,
          END OF g_t_itab.
    DATA: g_t_bdcdata TYPE TABLE OF bdcdata.
    DATA: path TYPE string,
          path1 type string.
    path = 'C:\Documents and Settings\ssr3kor\Desktop\TEST\test.txt'.
    path1 = 'C:\Documents and Settings\ssr3kor\Desktop\TEST\test1.txt'.
    *contents of test.txt    *
    *TEST1             ,BOT  *
    *TEST2             ,BOT  *
    *TEST3             ,BUT  *
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = path
      TABLES
        data_tab                      = g_t_itab.
    LOOP AT g_t_itab.
      WRITE:/1(18) g_t_itab-matnr, 20(40) g_t_itab-maktx.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       filename = path1
       filetype                      = 'ASC'
      TABLES
        data_tab                      = g_t_itab.
    Now you will get one .txt file with name 'TEST1.TXT' in the TEST folder.
    <b>REWARD POINTS IF IT IS HELPFUL</b>
    Regards
    Sasidhar Reddy Matli

  • How can I log the data transmission of my switch in a file to analyze the quality of my communication channel?

    How can I log the data transmission of my switch in a file to analyze the quality of my communication channels?

    A lot depends on what type of switch you have and what kind of communication channels you're asking about.
    There are several Cisco tools (e.g., "ip sla", SNMP-queried values, show commands etc.) that can give useful information.
    If you give us some more information we can help more specifically.

  • How can I get the Java EE 5 Compatibility Test Suite?

    How can I get the Java EE 5 Compatibility Test Suite?
    which department should I contact with in oracle company in china ?
    Who can tell me?
    thanks.

    The title of this forum is...
    Community Feedback and Suggestions (Do Not Post Product-Related Questions Here)
    And you thought this was the appropriate place to post this question ?:|

  • How can I get the java 2D java2D  tutorials�H

    How can I get the java 2D java2D tutorials which I dont need lookup it online?

    The download link for all the Java tutorial is here:
    http://java.sun.com/docs/books/tutorial/

  • How can I drop the java objects from a schema

    hi..good afternoon all...
    How can I drop the java objects from a database schema???
    suppose the credentials are scott/tiger@db1
    Another thing is that...I have to do this from cmd(command prompt) as there is no plsql developer or sqldeveloper installed in the machine.
    plss help...thanks in advance...

    hi...i have already tried all the options..but it is showing the error..
    ora:01435 - user does not exist
    but when i have given the command...
    select object type, object_name, status from user_objects where object_type like'%JAVA%';
    then it is showing that the java_object is present....
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    SQL>
    SQL>
    SQL> set linesize 200
    SQL>
    SQL>
    SQL>
    SQL> select object_type, object_name, status from user_objects where object_type
    like '%JAVA%';
    OBJECT_TYPE OBJECT_NAME
    STATUS
    JAVA CLASS javaclass1
    VALID
    JAVA SOURCE javaclass1
    VALID
    SQL> drop java source javaclass1.java;
    drop java source javaclass1.java
    ERROR at line 1:
    ORA-01435: user does not exist
    SQL>

  • How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    Did you check the help page for Correct Camera Distortion and Process multiple file
    Correct Camera Distortion: http://helpx.adobe.com/photoshop-elements/using/retouching-correcting.html#main-pars_headi ng_5
    Process multiple files: http://help.adobe.com/en_US/photoshopelements/using/WS287f927bd30d4b1f89cffc612e28adab65-7 fff.html#WS287f927bd30d4b1f89cffc612e28adab65-7ff6

  • How can I set the maximum number of restarts for my PDF files?

    I want sent my PDF to a friend,but I just allow him see it only twice.
    How can I set the maximum number of restarts for my PDF files?
    My software edition is Acrobat X

    In the old days when PDFs were only opened on desktops and only in Acrobat or Reader, scripting could fake security features and people were generally convinced. As there are so many ways to open a PDF without scripts ever being run (from mobile devices to in-browser display, or simply opening the file in Illustrator), none of that works anymore.

  • How can i run the java bean sample program download from OTN

    hello to all
    i have a p[roblem. i have downloaded the sample progam from oracle web site which is a java code that connect with the oracle and shows a form. how can i run the from.
    can any body help me pleaSEEE
    thanks
    kamran ahmed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi Darryl.Burke
    So your telling, we cannot run our Java Program when system shutdowns...In my application, when user has schedule for next days and he shutdown his PC. On the next day when System Started i should able to get back my schedule on the Specified time(I'm TimerTask class in Java)... How can i achieve this using Java? can u tell me clearly..

  • How can i open the "Convert to Indexed Color" dialog with custom presets?

    Hi,
    I need to automatically open the "Convert to Indexed Colors" dialog in Photoshop. Before and after that i have some scripts running so its not possible to open the dialog manually. Also i want to set some custom presets (like number of colors etc.).
    Found something similar to what i want for the Color Range selection (opens the dialog with the presets you put in):
    function colorrange(enabled, withDialog, fuzziness) {
        if (enabled != undefined && !enabled)
          return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        desc1.putInteger(app.charIDToTypeID('Fzns'),fuzziness);
        var desc2 = new ActionDescriptor();
        desc2.putDouble(app.charIDToTypeID('Lmnc'), 31.22);
        desc2.putDouble(app.stringIDToTypeID("a"), 0.86);
        desc2.putDouble(app.stringIDToTypeID("b"), 0.31);
        desc1.putObject(app.charIDToTypeID('Mnm '), app.charIDToTypeID('LbCl'), desc2);
        var desc3 = new ActionDescriptor();
        desc3.putDouble(app.charIDToTypeID('Lmnc'), 95.34);
        desc3.putDouble(app.stringIDToTypeID("a"), 54.59);
        desc3.putDouble(app.stringIDToTypeID("b"), 49.85);
        desc1.putObject(app.charIDToTypeID('Mxm '), app.charIDToTypeID('LbCl'), desc3);
        desc1.putInteger(app.stringIDToTypeID("colorModel"), 0);
        var desc4 = new ActionDescriptor();
        var desc4 = executeAction(app.stringIDToTypeID('colorRange'), desc1, dialogMode);
    How can i achieve the same for the indexed color conversion dialog? Apart from doing a lot of guessing regarding the stringIDs.
    Is there some kind of "lookup table" for char and string IDs?
    Thank you guys in advance! This forum has been a great help many times.

    Ok never mind i got it, stupid me.
    Recorded it with Script Listener and changed the "DialogMode" parameter of the executeAction function from "DialogModes.No" to "DialogModes.All".
    var idCnvM = charIDToTypeID( "CnvM" );
                var desc249 = new ActionDescriptor();
                var idT = charIDToTypeID( "T  " );
                    var desc250 = new ActionDescriptor();
                    var idPlt = charIDToTypeID( "Plt " );
                    var idClrP = charIDToTypeID( "ClrP" );
                    var idSele = charIDToTypeID( "Sele" );
                    desc250.putEnumerated( idPlt, idClrP, idSele );
                    var idClrs = charIDToTypeID( "Clrs" );
                    desc250.putInteger( idClrs, 4 );
                    var idFrcC = charIDToTypeID( "FrcC" );
                    var idFrcC = charIDToTypeID( "FrcC" );
                    var idNone = charIDToTypeID( "None" );
                    desc250.putEnumerated( idFrcC, idFrcC, idNone );
                    var idTrns = charIDToTypeID( "Trns" );
                    desc250.putBoolean( idTrns, false );
                    var idDthr = charIDToTypeID( "Dthr" );
                    var idDthr = charIDToTypeID( "Dthr" );
                    var idDfsn = charIDToTypeID( "Dfsn" );
                    desc250.putEnumerated( idDthr, idDthr, idDfsn );
                    var idDthA = charIDToTypeID( "DthA" );
                    desc250.putInteger( idDthA, 75 );
                var idIndC = charIDToTypeID( "IndC" );
                desc249.putObject( idT, idIndC, desc250 );
            executeAction( idCnvM, desc249, DialogModes.ALL ); //Change from NO to ALL

  • How can I save the java console to a file in JDK 1.5

    There was a option in the java webstart perefernce before JDK 1.4.....For some reason, i can not find it any more in 1.5..... :(

    Thanks for your suggetion, but sometimes it is pretty difficult add my own stream into a exiting large project, especially the source of some jar file are not available......
    Also is there any suggestion on how to redirect the System.out and System.err for a web start app......
    Another quick question, would you please tell me how i can enlarge the console buffer please?......
    Thx in advance

  • How can I display the correct enum ring value from a parameter file?

    A user will make selections based on the menu ring (there are several of these) and then the values are saved for later use as a parameter (text) file. I have several menu rings which I write out to a parameter (text) file.
    How can I take these text values back into the appropriate location in the menu ring. For example, if I have menuring_value at index 0, menuring_value at index 1, etc. how do I make sure that, when the par (text) file is loaded, the saved values are the ones displayed without erasing the displayed menu ring value and inputting the saved one (from the parameter file). I would like the text value to search the appropriate menu ring, make a match and then display that menu ring value when the parameter file is loaded.

    If I understand your question, attached VI should have solved your doubt
    In this example, Configuration File VIs are used to save & retrieve MenuRings' statuses.
    As this VI is improvised, please further modify it to suit your needs.
    Cheers!
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    GUI_Menu Ring Status Save & Retrieve.vi ‏69 KB

  • How can we install the Java Plugin from the html page

    Hi,
    I am using java plugin 1.3.1_02 for my applet pages.
    How can I install that plugin in the client machine without installing manually.
    I used,
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="600" height="400" align="middle"
         codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,1,2">
    <PARAM NAME="code" VALUE="SignedAppletDemo.class">
    <PARAM NAME="archive" VALUE="SSignedApplet.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    </OBJECT>
    But it is downloading java plugin 1.3.1_03.
    Can anybody help me
    Thanks & Regards
    Raja

    Using object tags is the correct way and only way to download the plugin and let the client decide whether he can download it r not. There is no way to install automatically
    I dont think there is a way to install automatically without a user intervention coz, it can open the floodgates for potential hackers.
    Can u cite an example about which programs can be installed automatically and why do u want the plugin to be installed automatically?
    ciao

  • How can I configure the Java ME Emulator (3.0) on Mac to launch a browser?

    Hi all.
    I'm a non-developer user of the Java ME Emulator, where I need to test J2ME applications. I run the Java J2ME ME Emulator on my Mac, version 3.0.
    I usually run the emulator as such:
    /Applications/Java_ME_SDK_3.0.app/Contents/Resources/bin/emulator -Xdescriptor:/path/to/jad
    However, in our application I'm testing - whenever I click a URL/Link that normally opens a browser on a real device - it does nothing on the emulator. How can I get this to work? I've loaded up the 'Java_ME_SDK_3.0' App (/Applications/Java_ME_SDK_3.0.app) and found the settings there for this (Preferences -> General -> Web Browser) however, no matter what I put in there seems to work. (No browser even launches/opens)
    Can someone please help me?
    Thanks
    Ryan Hunt.

    Hello TwoTankAmin, the Java deployment Toolkit is for developers and used by Java applications to help manage getting the right version of Java for a user’s system. Are you sure the problem is there ?
    Do you have it '''Always Activate''', in Add-ons Manager tab and the Java TM platform SE 7 U67 also? [https://support.mozilla.org/en-US/kb/troubleshoot-issues-with-plugins-fix-problems#w_determining-if-a-plugin-is-the-problem Determining if a plugin is the problem].
    thank you

  • How can I customize the Java Report Panel applet splash screen?

    Has anyone found a quick and easy way, either via javascript or a webi properties file, to cutomize the splash screen for the Java Reporting Panel applet while it is loading?  I've found a few code snippets for the javascript approach, but they don't quite work, and apparently there's a webi properties file that I should be able to use to accomplish this, but where is it exactly?  Is it on the BO server, or should it be in a jar file in my project.  Can't seem to find it.  Thanks for any help.

    Look at the link I posted, you aren't double buffering correctly.
    I saw the other post you mistakenly made before you edited it. Not really a big deal, I was just wondering why you did that.

Maybe you are looking for