How do copy a file to desktop in java

I am creating some overlays for a program to import. It creates some simple text files. We would like the default location for these files to be the user desktop (something like %DESKTOP%)...Does anyone know how to direct a file to desktop using system variables etc. I am not sure if System object contains a reference to the user desktop...
Right

Hello, hope that you are fine ...
What you have to do is the following :
File desktopDIR=new File("C:\\Documents and Settings\\All Users\\Desktop");
File theFileToCopy=new File(desktopDIR,"fileName.extension");
// then
theFileToCopy.createNewFile();
// now copy the data to the file using the needed writers ...Regards ...

Similar Messages

  • Does anyone know how to copy my files from my ipod to a different computer?

    Does anyone know how to copy my files from my ipod to a different computer? I tried to do it, but all that it did was erase my files. What i want to to is use my ipod to transfer my files to another computer (which has itunes as well) PLEASE help!

    You will need to enable your iPod for disk use. Then, you should see your iPod in "My Computer" and you can open up your iPod's folder there and drag the files into it. You can store the files on the iPod, then connect it to the other computer and drag-and-drop them from the iPod into the designated directory in that computer. Make sure individual files are not larger than 4 GB.

  • How to copy pdf files from computer to ipad

    how to copy pdf files from computer to ipad

    You can PDFs to the iPad, but first you need one or more apps on the iPad that supports PDFs - unlike a 'normal' computer the iPad doesn't have a file system, and everything on it has to be associated with an app.
    Options include free apps such as Apple's iBooks app and also Adobe Reader - and paid-for apps such as GoodReader (which also supports read-only of other documents types).
    For iBooks you can first add the PDFs to your computer's iTunes via File > Add To Library, and you can then sync them by selecting the iPad on the left-hand sidebar of your computer's iTunes (on iTunes 11 you can enable the sidebar via option-command-S on a Mac, control-S on a PC) and using the Books tab on the right-hand side to select and sync them.
    For Adobe Reader adnd GoodReader you can use the file sharing on the Apps tab on the right-hand side to copy them over : http://support.apple.com/kb/ht4094

  • How to extract .sit files(in MAC)  using java program

    Hi,
    please help me , i want to simple program for
    " how to extract .sit files(in MAC) using java program"
    that sit files same as zip files in windows..[                                                                                                                                                                                                                                                                                                                                   

    Thanks for reply...
    but i search in the google about this topic...there is no results will appear..
    the problem is "i have to run program in the MacOS like extract all the
    .sit(StuffIt) extension files. These sit files same as zip files in the windows... we have one tool called StuffIt Expander but it is 3rd party tool. but here requirement is i have to write my own program to extract all the files same as zip file program...
    please do the needful..i am waiting for ur reply,,,

  • How to write certain file On jCD through Java

    hi all,
    I got big problem in java , would anybody tell me how to write certain file onto CD through java. Is there any API available for this.
    Thanks in advance
    --Harish                                                                                                                                                                                                                                                                                                                                                               

    You might check this thread.
    http://forum.java.sun.com/thread.jspa?threadID=212748&tstart=90

  • How to Copy a file from iPod Touch to iMac

    I have used the native "Voice Recorder" app on an iPod Touch to record lectures.  Generally, when the iPod is synced with the iMac, the files are copied from the iPod to the iMac and are located in "Voice Memos" on the iMac.  I have two files that didn't copy to the iMac.  They are still on the iPod.  I have rebooted both machines several times and tried to sync afterward.  The two files remain on the iPod, but aren't on the iMac.  I would like to transfer the files to a thumb drive, but I cannot access them on the iPod in order to copy or move them.
    From what I've read, there used to be a function in iTunes that was "enable disk use".  Then you could view the memory of the iPod and move or copy files.
    The iPod has iOS 5.1.1.  It is a modelMC008LL.  The iMac has OS X 10.7.3, 2.93 GHz Intel processor, 24" screen, and was produced in 2009.

    I used iFunBox to access the files.  I was not able to copy them to the "Voice Memos" directory on the iMac, but they copied fine to the Desktop on the iMac.  That is puzzling to me.
    Using iFunBox, I looked at a directory on the iPod called Raw File System.  I was looking at voice memos.  Several had five or more duplicates.  The duplicates aren't visible on the iPod itself.  I also found a Quick Time Movie file that I didn't recall.  When I launched it, there was only sound.  It was a voice memo that I had recorded five years ago.  After recording it, I could not find it on the iPod.  It appeared to be deleted and I had been careful to not delete it.  I don't understand how it ended up as an .mov file as opposed to an .m4a file.  The iFunBox app showed that file under the Raw File System and also under the Voice Memos directory.
    I like the audio quality of the Voice Memo recordings, but its file handling is quirky. 
    Thank you for suggesting iFunBox.  It allowed me to solve the problem of getting two files off of the iPod that I couldn't do in the normal way and I discovered and recovered a file that had been hidden for five years.

  • How to copy selected files to cd

    how do i copy selected files to cd

    The easiest way, at least for me, is to open a folder on the desktop.
    Copy the  selected files in to this folder. This will be the source folder.
    Use the software that came with your computer and burn the CD

  • How to copy/delete file

    hi,
    i need to come out a program, which can copy/delete file from unix directory A to directory B, on the application server.
    does any one have any idea how am i going to code the abap program for this?
    thanks

    > i need to come out a program, which can copy/delete file from unix directory A to directory B, on the application server.
    >
    i am assuming that your Application server is Unix.
    unixcommand cp is used to copy the a file from one directory to another.
    cp /dir/file1 /dir2/file2
    the above command will copy the file1 of dir1 to file2 of dir2.
    for delete use the command rm,
    rm /dir/fiel1
    the above command will remove the file1 from directory dir.
    REPORT ZUNIX line-size 400
                    no standard page heading.
    parameters : unixcom like   rlgrap-filename.  
    data: begin of tabl occurs 500,
            line(400),
          end of tabl.
    data: lines type i.
    start-of-selection.
      refresh tabl.
      call 'SYSTEM' id 'COMMAND' field unixcom
                    id 'TAB'     field tabl[].
    "if any error or any thing you get in the tabl
    "just check the tabl once after the finishing

  • How to copy a file from Client to Application Server

    Hello,
    My requirement is user selects a file from Browse button on oracle form - this location is on client side, and have to copy this file on Application server.
    I tried using webutil_file.copy_file function but it gives error - copy_file is not a procedure or is undefined.
    There is another way of Client_to_AS but it needs some changes in configuration files of webutil, which is not allowed in our scenario.
    Source - client machine resident file
    Target- Application server disk location
    So can any one help in this regard?

    Hi Francois,
    Thanks for your suggestion, actually i didnt want to use Client_to_As as client doesnt want to make any changes in any configuration files, no matter how small the change is.
    Anyways we are able to successfully copy the file using Client_to_AS, but one thing that i couldn't understand is why was our webutil_file.copy_file function failing?
    Any hint about this?
    Thanks!
    Avinash.
    Pune- India.

  • How to copy a file from one folder to another folder in Linux

    Hello everyone,
    Oracle forms 11g 11.1.2.0.0
    OS: Oracle Linux
    We use webutil to upload files to the application server from the client machine, and stores them in a folder named JOB_DOCS on the application server (This folder is created as a databse directory too). File types are JPEG, GIF, PDF, TXT, BMP, DOC, XLS etc...
    At a later stage when the user tries to view the uploaded documents, this was not getting displayed on the screen
    on our windows server, when the user clicks on the print button we copy the file from the JOB_DOCS folder to the forms\java folder using the below command
    HOST('COPY ' ||d:\JOB_DOCS\test.pdf||' '||'c:\oracle\middleware\as\forms\java\test.pdf ,NO_SCREEN);
    once the file is under the forms\java folder then it is getting displayed on the screen to print or save, and later we remove the file from forms\java folder.
    But my problem here is, recently we have installed our application on Oracle Linux server, and we have JOB_DOCS folder there, and the users can upload files to this folder also. How can we copy the file test.pdf from JOB_DOCS to forms/java in linux?
    And what could be the reson for the document cannot be accessed from the folder where it is saved? We tried giving folder permissions, adding the folder to PATH variable etc.

    For copying and moving directories you can use the cp and mv commands just like you use them with files. Yeah, I know. If you've already tried to copy a directory with cp, you've probably noticed that cp just complains at you. Probably it says something like cp: omitting directory yadda yadda. You see, the cp command wants you to use the -r option if you want to copy a directory with its contents. The -r means "copy recursively":
    $ cp -r dir1 dir2
    The above creates a directory named dir2 whose contents will be identical to dir1. However, if dir2 already exists, nothing will be overwritten: the directory dir1 will be copied into the dir2 directory under the name dir2/dir1.
    When renaming directories, you use the mv command exactly the same way as with files:
    $ mv dir1 dir2
    When dealing with directories, mv works a bit like cp does. If dir2 doesn't exist, the above will rename dir1 to dir2, but if dir2 exists, the directory dir1 will be moved into the dir2 directory under the name dir2/dir1.
    ref http://www.tuxfiles.org/linuxhelp/dirman.html

  • How to copy a file with subdirectory tree

    The output for the code will copy a .doc file from c:/copy to c:/test. How am I able to copy a tree directory. For example from c:/copy/1.doc, c:/copy/tutor/2.doc to c:/test/1.doc, c:/test/tutor/2.doc?
    import java.io.*;
    import java.util.*;
    public class DocCapture {
        public static void main(String [] args) throws IOException{
            List<File> javaFiles = new ArrayList<File>();
            File topDir = new File ("C:/Copy");
            if (topDir.isDirectory())
                javaFiles = getFiles(topDir);
            System.out.printf("Found %d js files is directory %s and its sub-directories. ",javaFiles.size(), topDir.getName());
            System.setOut(new PrintStream(new FileOutputStream ("C:/Copy/Location.txt")));
            for (File f : javaFiles)
                System.out.println("JSMinifier " + f.getPath() + " " + f.getPath() + " NOUI");
        private static List<File> getFiles (File dir)
            List<File> fileList = new ArrayList<File>();
            File [] files = dir.listFiles();
            for (int i = 0; i<files.length; i++)        {
                if(files.isDirectory())
    fileList.addAll(getFiles(files[i]));
    else if(files[i].getName().endsWith(".doc"))
    fileList.add(files[i]);
    String fileName = files[i].getName();
    String name = "";
    String ext = "";
    try
    name = fileName.substring(0, fileName.indexOf("."));
    ext = fileName.substring(fileName.lastIndexOf("."), fileName.length());
    if (ext.equals(".doc")) copy(files[i], new File("C:/Test/" + name + ext));
    catch (IndexOutOfBoundsException e){
    System.out.println(fileName + " has no extension");
    return fileList;
    public static void copy (File src, File dst){
    try
    InputStream in = new FileInputStream(src);
    OutputStream out = new FileOutputStream(dst);
    byte [] buf = new byte [1024];
    int len;
    while ((len = in.read(buf))>0)
    out.write(buf, 0, len);
    in.close();
    out.close();
    System.out.println("File copied"+src.getPath()+dst.getPath());
    catch (IOException e){
    e.printStackTrace();

    To copy source directory D to target directory D' recursively:
      For every plain file in D
        copy that file to D'
      For every directory D2 in D
        recursively copy D2 to its equivalent path D2' using this algorthm

  • How to copy archivelog-files from a ASM instance to another ASM instance

    Hello ,
    our RAC database has to be moved to another Datacenter. The database has a size of several Terrabyte. Will will create a standby database (on a cluster) on the new datacenter (using RMAN backup). Since the RMAN backup takes rather long we would like to copy the archive logs to the new datacenter. Since the archivelog-files are stored on a dirskgroup of an asm instance we have the following question:
    - how can the archivelog files get copied from the current location to the new location?
    Rgds
    Jan

    VivaLaVida wrote:
    Many thanks for your answer...
    As a matter of fact the archivelogs are not backuped on a filesystem. If so we would copy them from the source to the destination host (that's easy).
    The question is "how to get them copied from one ASM diskgroup to another ASM diskgroup". RMAN might be a good solution - but we would need to
    figure that out...
    We talking about 100 GB of archivelogs a day - therefore we don't want to wait until the standby database is configured and online. To have the archivelogs
    already on the new host in the new datacenter would save alot of time.What is ASM version?
    The copy is peer to peer? (i.e Can you copy files from one ASM to another directly?)

  • How to copy referenced files into iPhoto library

    I have a mixture of referenced files and copies in my iPhoto library. I changed now the preferences to always copy files when importing new photos. But, how can I copy the old referenced photos into my library (they are all over the place)? Is there anything like "Copy all files to the library"?

    csmun
    Welcome to the Apple Discussions.
    But, how can I copy the old referenced photos into my library (they are all over the place)? Is there anything like "Copy all files to the library"?
    I'm afraid there isn't - you'll need to do it the hard way I'm afraid.
    What might help is to go into the Library/Originals folder and examine the aliases there. Right click on an alias and select 'Show Original' A finder window will pop open with the Original File. Then replace the alias with the original.
    Regards
    TD

  • Captivate 6 copying multiple files on Desktop while recording

    Description
    When I am recording with Adobe Captivate 6, it is copying multiple files on my laptop desktop automatically. They are all full motion shock wave flash files? Is there a setting I can adjust so it does not do this or is there a reason why it does this? When I recorded a two minute software simulation, it put about 20 files on my desktop. I deleted them all and started over and it is doing it gain. I've attached what my desktop looks like with the icons with just four of them.

    I followed you instruction but it didn't work.
    I am doing the video demonstration recording and it shows the fmr file types on my desktop.
    The default is showing to my Desktop.
    C:\Users\COONCE\Documents\Adobe Captivate Cached Projects
    When I try to enter the path they gave, My Documents\My Adobe Captivate Projects, I get an alert that is not a valid location. I tried changing it to Libraries\Documents\My Adobe Captive Projects but it still puts them on my desktop. Am I just entering the wrong path?

  • ASM lost disk, rebuilt disk grp. No dbid, how to copy ctl file to ASM?

    Hi all,
    I'm trying to help out on what is turning out to be a real challenge.
    This looks to be Oracle 10.1.0.4.0 (version showed by rman and sqlplus).
    There is ASM...but it was set to redundancy of EXTERN, but not really external redundancy. This is a test box, and I guess they were just trying to use what disks they had....I dunno, it was set up long before I got here.
    Out of all the instances I've had to look at....for this one server, I have no DBID's documented.
    This is a HP-UX box....they replaced the bad ASM drive, and I rebuilt the DATADG disk group.
    RMAN settings...well, show all just gives defaults, as that I don't have a control file in place. This was, however, set up to autobackup control files and spfiles...but I don't know the DBID, and can't figure how to find the DBID....
    I did, however, find the snapshot controlfile...and hoping I could use that.
    I am, however, stumped as to how to copy this copy of the control file, into ASM.
    I have found and old pfile that I can use to start the instance. I have started it nomount with this.
    I looked at the parameter for control file and found:
    SQL> show parameter control_file
    NAME TYPE VALUE
    control_file_record_keep_time integer 7
    control_files string +DATADG/instance/control01.ctl
    , +DATADG/instance/control02.c
    tl, +DATADG/instance/control03
    .ctl, +DATADG/instance/control
    04.ctl
    So, I know where they are to go. This is such an old version, I guess there was no ASMCMD...I can't find that command.
    I'm thinking, if I could find a way to copy this snapshot of the control file onto ASM in the old places it was, I could startup up the database, and it would then be able to restore and recover with the RMAN backups?
    Any suggestions?
    cayenne

    Just a quick update on this.
    I was able to find a snapshot of the controlfile on disk....
    I went into asm and recreated the directory where the controlfiles were kept, and used rman to copy the snapshot controlfile to where the originals were kept:
    export ORACLE_SID=+ASM
    connect with sqlplus and do:
    SQL> alter diskgroup DATADG add directory '+DATADG/instance';
    Diskgroup altered.
    Then in RMAN:
    restore controlfile to '+DATADG/instance/control01.ctl' from '/u01/app/oracle/product/10.1.0/Db_1/dbs/snapcf_INSTANCE.f';
    restore controlfile to '+DATADG/instance/control02.ctl' from '/u01/app/oracle/product/10.1.0/Db_1/dbs/snapcf_INSTANCE.f';
    restore controlfile to '+DATADG/instance/control03.ctl' from '/u01/app/oracle/product/10.1.0/Db_1/dbs/snapcf_INSTANCE.f';
    restore controlfile to '+DATADG/instance/control04.ctl' from '/u01/app/oracle/product/10.1.0/Db_1/dbs/snapcf_INSTANCE.f';
    I then got out of RMAN...back into sqlplus and mounted the database instance:
    SQL> connect / as sysdba
    Connected.
    SQL> alter database mount;
    Database altered.
    Checking to see backups:
    RMAN> run {
    2> allocate channel vh1 type sbt_tape;
    3> restore database preview;
    4> }
    allocated channel: vh1
    channel vh1: sid=321 devtype=SBT_TAPE
    channel vh1: NMO v4.1.0.0
    Starting restore at 30-SEP-11
    Starting implicit crosscheck backup at 30-SEP-11
    Finished implicit crosscheck backup at 30-SEP-11
    Starting implicit crosscheck copy at 30-SEP-11
    Finished implicit crosscheck copy at 30-SEP-11
    searching for all files in the recovery area
    cataloging files...
    cataloging done
    no files cataloged
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    33235 Incr 0 9G SBT_TAPE 00:23:51 11-AUG-11
    List of Datafiles in backup set 33235
    File LV Type Ckp SCN Ckp Time Name
    1 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/system.413.573936825
    2 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/undotbs1.409.573936855
    3 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/sysaux.406.573936867
    4 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/users.432.573936895
    5 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/rcv_cat.437.573987643
    6 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/mgmt_tablespace.448.574422259
    7 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/mgmt_ecm_depot_ts.844.574422261
    8 0 Incr 330744282 11-AUG-11 +DATADG/instance/datafile/oem_repository.533.574022071
    Backup Set Copy #1 of backup set 33235
    Device Type Elapsed Time Completion Time Compressed Tag
    SBT_TAPE 00:23:51 NO WEEKLY_INSTANCE_081111040003
    List of Backup Pieces for backup set 33235 Copy #1
    BP Key Pc# Status Media Piece Name
    34399 1 AVAILABLE server.003 fjmjmnmo_1_1
    34400 2 AVAILABLE server.003 fjmjmnmo_2_1
    34401 3 AVAILABLE server.003 fjmjmnmo_3_1
    34402 4 AVAILABLE server.003 fjmjmnmo_4_1
    34403 5 AVAILABLE server.003 fjmjmnmo_5_1
    Finished restore at 30-SEP-11
    released channel: vh1
    I think I'm ready to try to figure out the restore and recover parts now....
    I tried to recover the spfile from autobackup...but that didn't work:
    RMAN> restore spfile from autobackup;
    Starting restore at 30-SEP-11
    allocated channel: ORA_SBT_TAPE_1
    channel ORA_SBT_TAPE_1: sid=321 devtype=SBT_TAPE
    channel ORA_SBT_TAPE_1: NMO v4.1.0.0
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=320 devtype=DISK
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110930
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110929
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110928
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110927
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110926
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110925
    channel ORA_SBT_TAPE_1: looking for autobackup on day: 20110924
    channel ORA_SBT_TAPE_1: no autobackup in 7 days found
    recovery area destination: +RECOVERYDG
    database name (or lock name space) used for search: INSTANCE
    channel ORA_DISK_1: no autobackups found in the recovery area
    channel ORA_DISK_1: looking for autobackup on day: 20110930
    channel ORA_DISK_1: looking for autobackup on day: 20110929
    channel ORA_DISK_1: looking for autobackup on day: 20110928
    channel ORA_DISK_1: looking for autobackup on day: 20110927
    channel ORA_DISK_1: looking for autobackup on day: 20110926
    channel ORA_DISK_1: looking for autobackup on day: 20110925
    channel ORA_DISK_1: looking for autobackup on day: 20110924
    channel ORA_DISK_1: no autobackup in 7 days found
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 09/30/2011 10:01:09
    RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
    Anyway...further along than I was.....
    Suggestions welcome....
    cayenne

Maybe you are looking for

  • A Sysprep question on SID changes

    Hello, I have an issue with Sysprep and the Generalize option in WIN 7. According to all M/S conventional wisdom I need to run this pass to remove COMPUTER NAME and SID's on a machine that I am going to deploy to the field multiple times.  I have cre

  • Financial Statement

    Hi all I am creating a customized report of Financial Statement that contains monthly figures for every G/L account. When I compared my report with the standard FS, I found out in standard FS, there are some G/L are taking amount from previous fiscal

  • The PC Suite File Manager does not work with NOKIA...

    Hi OS: XP SP2 Pone Model: 3120 Thhe version of Pc Suite is 6.5.12 the ERROR is: "the operation could not be complited" When I try to update my phone messages between my phone and my computer via pc suite file manager,it shows below error : "the opera

  • OSX 10.4.6  connection to Windows Server 2003

    OK guys I need serious help here and in the most basic terms you can describe them in. I'm not an IT guy, and our IT guy knows nothing about Macs. This will be a long post, I appologize, but if you think you can help, please read through it. We have

  • OS X says boot disc full when it isn't - by a long way

    I ran SuperDuper last night and the backup failed with an unknown error. After, Spotlight didn't find files. I rebooted and at the login screen was given the error message 'backup disc full, delete some files' - problem is, OS X won't boot beyond the