IMPORTANT. copying files in java

i would like to know how do i copy a file form one dir to another or do i have to just read from one file and write it to the other?? thanks for all the help

look at the "java.nio.*" package:
http://java.sun.com/j2se/1.4/docs/api/java/nio/channels/package-summary.html
http://java.sun.com/j2se/1.4/docs/api/java/nio/package-summary.html

Similar Messages

  • Copy file in java

    i copy a picture from one location to another using FileInpustStream method..
    is there any better way to copy file faster, cause using this way takes way to much time to copy a picture file
              try
                   FileInputStream r=new FileInputStream(new File(source));
                   FileOutputStream w=new FileOutputStream(new File(destination));
                   int only;
                   while((only=r.read())!=-1)
                        w.write(only);
                   r.close();
                   w.close();
              catch(Exception er)
                   System.out.println(er);
              }

    Here's the difinitive tutorial on java io performance tweaks:
    http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/
    Based on the examples there in (plus some of my own illconceived numbknuckle (think about it) ideas:-)
    package krc.utilz.io;
    import java.util.Collection;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.io.File;
    import java.io.Reader;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.io.InputStream;
    import java.io.FileInputStream;
    import java.io.Closeable;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    * @class: krc.utilz.io.Filez
    * A collection of static "file handling" helper methods.
    public abstract class Filez
      public static final int BFRSIZE = 4096;
       * reads the given file into one big string
       * @param String filename - the name of the file to read
       * @return the contents filename
      public static String read(String filename)
        throws FileNotFoundException
        return Filez.read(new FileReader(filename));
       * Reads the contents of the given reader into one big string, and closes
       * the reader.
       * @param java.io.Reader reader - a subclass of Reader to read from.
       * @return the whole contents of the given reader.
      public static String read(Reader in)
        try {
          StringBuffer out = new StringBuffer();
          try {
            char[] bfr = new char[BFRSIZE];
            int n = 0;
            while( (n=in.read(bfr,0,BFRSIZE)) > 0 ) {
              out.append(bfr,0,n);
          } finally {
            if(in!=null)in.close();
          return out.toString();
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * (re)writes the given content to the given filename
       * @param String content - the new contents of the fil
       * @param String filename - the name of the file to write.
      public static void write(String content, String filename) {
        try {
          PrintWriter out = null;
          try {
            out = new PrintWriter(new FileWriter(filename));
            out.write(content);
          } finally {
            if(out!=null)out.close();
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * Appends the given content to the given filename.
       * @param String content - the string to write to the file.
       * @param String filename - the name of the file to write to.
      public static void append(String content, String filename) {
        try {
          PrintWriter out = null;
          try {
            out = new PrintWriter(new FileWriter(filename, true)); //true=append
            out.write(content);
          } finally {
            if(out!=null)out.close();
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * reads each line of the given file into an array of strings.
       * @param String filename - the name of the file to read
       * @return a fixed length array of strings containing file contents.
      public  static String[] readArray(String filename)
        throws FileNotFoundException
        return readList(filename).toArray(new String[0]);
       * reads each line of the given file into an ArrayList of strings.
       * @param String filename - the name of the file to read
       * @return an ArrayList of strings containing file contents.
      public static ArrayList<String> readArrayList(String filename)
        throws FileNotFoundException
        return (ArrayList<String>)readList(filename);
       * reads each line of the given file into a List of strings.
       * @param String filename - the name of the file to read
       * @return an List handle ArrayList of strings containing file contents.
      public static List<String> readList(String filename)
        throws FileNotFoundException
        try {
          BufferedReader in = null;
          List<String> out = new ArrayList<String>();
          try {
            in = new BufferedReader(new FileReader(filename));
            String line = null;
            while ( (line = in.readLine()) != null ) {
              out.add(line);
          } finally {
            if(in!=null)in.close();
          return out;
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * reads the whole of the given file into an array of bytes.
       * @param String filename - the name of the file to read
       * @return an array of bytes containing the file contents.
      public static byte[] readBytes(String filename)
        throws FileNotFoundException
        return( readBytes(new File(filename)) );
       * reads the whole of the given file into an array of bytes.
       * @param File file - the file to read
       * @return an array of bytes containing the file contents.
      public static byte[] readBytes(File file)
        throws FileNotFoundException
        try {
          byte[] out = null;
          InputStream in = null;
          try {
            in = new FileInputStream(file);
            out = new byte[(int)file.length()];
            int size = in.read(out);
          } finally {
            if(in!=null)in.close();
          return out;
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * do files A & B have the same contents
       * @param String filenameA - the first file to compare
       * @param String filenameA - the second file to compare
       * @return boolean do-these-two-files-have-the-same-contents?
      public static boolean isSame(String filenameA, String filenameB)
        throws FileNotFoundException
        try {
          File fileA = new File(filenameA);
          File fileB = new File(filenameB);
          //check for same physical file
          if( fileA.equals(fileB) ) return(true);
          //compare sizes
          if( fileA.length() != fileB.length() ) return(false);
          //compare contents (buffer by buffer)
          boolean same=true;
          InputStream inA = null;
          InputStream inB = null;
          try {
            inA = new FileInputStream(fileA);
            inB = new FileInputStream(fileB);
            byte[] bfrA = new byte[BFRSIZE];
            byte[] bfrB = new byte[BFRSIZE];
            int sizeA=0, sizeB=0;
            do {
              sizeA = inA.read(bfrA);
              sizeB = inA.read(bfrB);
              if ( sizeA != sizeB ) {
                same = false;
              } else if ( sizeA == 0 ) {
                //do nothing
              } else if ( !Arrays.equals(bfrA,bfrB) ) {
                same = false;
            } while (same && sizeA != -1);
          } finally {
            Clozer.close(inA, inB);
          return(same);
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * checks the given filename exists and is readable
       * @param String filename = the name of the file to "open".
       * @param OPTIONAl String type = a short name for the file used to identify
       *  the file in any exception messages.
       *  For example: "input", "input data", "DTD", "XML", or whatever.
       * @return a File object for the given filename.
       * @throw FileNotFoundException if the given file does not exist.
       * @throw IOException if the given file is unreadable (usually permits).
      public static File open(String filename)
        throws FileNotFoundException
        return(open(filename,"input"));
      public static File open(String filename, String type)
        throws FileNotFoundException
        try {
          File file = new File(filename);
          String fullname = file.getCanonicalPath();
          if(!file.exists()) throw new FileNotFoundException(type+" file does not exist: "+fullname);
          if(!file.canRead()) throw new RuntimeIOException(type+" file is not readable: "+fullname);
          return(file);
        } catch (IOException e) {
          throw new RuntimeIOException(e.getMessage(), e);
       * gets the filename-only portion of a canonical-filename, with or without
       * the extension.
       * @param String path - the full name of the file.
       * OPTIONAL @param boolean cutExtension - if true then remove any .ext
       * @return String the filename-only (with or without extension)
      public static String basename(String path) {
        return(basename(path,false));
      public static String basename(String path, boolean cutExtension)
        String fname = (new File(path)).getName();
        if (cutExtension) {
          int i = fname.lastIndexOf(".");
          if(i>0) fname = fname.substring(0,i);
        return(fname);
    }Use it freely. Modify it. Improve it, and pass it back to the community free of charge, except if you are a serving member of the military (any of them), a spook, a drug dealer, an arms manufacturer, an arms dealer, a defense contractor, or a "security consulant", in which case you can go f&#117;ck yourself, sorry.
    Cheers. Keith.

  • I need help with copying files in java?

    hi, i use the following code sample to copy a directory structure and its files.
    It copy's the directory-structure, but all the files in it have 0kb as size. except one file.
    Here's the code:
    public static void copyDir(String source, String target)
    String [] listing = new String [0];
    FileReader in = null;
    FileWriter out = null;
    String sourcePath = source;
    String targetPath = target;
    // Maakt directory onder target directory
    File f = new File(targetPath);
    f.mkdir();
    // Maakt filelist van bestanden in source-directory
    f = new File(sourcePath);
    listing = f.list();
    for(int i = 0; i < listing.length; i++)
    f = new File(sourcePath + listing);
    if(f.isDirectory())
    copyDir(source + listing[i] + File.separatorChar,
    target + listing[i] + File.separatorChar);
    else
    try
    in = new FileReader(sourcePath + listing[i]);
    out = new FileWriter(targetPath + listing[i]);
    int t;
    while (-1 != (t = in.read()))
    out.write(t);
    try { Thread.sleep(200); } catch (InterruptedException e) { }
    System.out.println("Copied: " + sourcePath + listing[i]);
    catch (Exception e)
    System.out.println(e);

    Here is a quick copy program that works. You'll need to deal with the exception instead of just throwing it though.
    import java.io.*;
    public class Copy
      private static void copy(String source, String target) throws IOException
        // Create directory
        File file=new File(target);
        file.mkdirs();
        // Get contents
        file=new File(source);
        File[] files=file.listFiles();
        // Copy files
        int length;
        byte[] buffer=new byte[1024];
        for(int i=0; i<files.length; i++)
          String destination=target+File.separator+files[ i ].getName();
          if(files[ i ].isDirectory())
            copy(files[ i ].getPath(), destination);
          else
            FileInputStream in=new FileInputStream(files[ i ]);
            FileOutputStream out=new FileOutputStream(destination);
            while((length=in.read(buffer))!=-1)
              out.write(buffer, 0, length);
            in.close();
            out.close();
      public static void main(String[] args) throws IOException
        copy(args[0], args[1]);
    }[\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can i import dll files in java project in eclipse?

    Hi All,
    How can i import or link dll files in java project in eclipse?....
    dll files contains
    import com.ms.com.ComLib;
    import com.ms.com.Variant;
    import com.ms.com.ComFailException;
    import com.ms.wfc.data.AdoException;
    import com.ms.wfc.data.AdoEnums;
    Any idea of this please tell me.....
    I am using eclipse 3.4 and JRE 1.4
    Is this possible?
    Please tell me!!!!!!!!!!!!!
    Voddapally

    iMovie cannot edit mpg files, unles they come directly from a supported camera.
    I would suggest that you use a free third party app to convert it.
    Get MPEG Streamclip from Squared 5, which is free.
    Drag you mpg clip into MPEG Streamclip.
    Then, FILE/EXPORT USING QUICKTIME
    Choose Apple Intermediate Codec, and save it where you can find it. You should be able to import this file into iMovie, using the FILE/IMPORT/MOVIE command.
    Note: If your file is an MPEG2 clip, you may need to purchase the Apple QuickTime MPEG2 Playback Component from Apple. MPEG Streamclip will tell you if you need this. Don't buy it unless you have to. It costs about $20. You just have to install the component. MPEG Streamclip will use it in the background.

  • Copying Files in Java

    How can I code in Java the copying of a file from one directory to another. I am trying to copy a Database from one folder to another and I do not want to use streams because this will read in characters or bytes but the Database is made up of tables. I thought there might be a method called 'copy' in the Java API, but I cannot find it anywhere.
    The closest I have got to the solution is the use of renameTo method in the Java API. However this copies the file but also removes it from the original location (like cut and paste). Is there a way of using a method similar to that so I get the file in both locations?
    Thanks in advance.

    Here's a utility class I wrote specifically for that purpose. It contains a method for copying files, and one for copying entire directories(including sub-directories).
    I use this mostly to move around mySql databases.
    http://www.auburn.edu/~bradfje/FileUtil.txt
    1. copyDirectory(String source, String destination)
    source is the directory to be copied, destination is what you want the new diretory to be called. Use absolute file names.
    2.copyFile(String source, String destination)
    same remarks as above.

  • Importing jar files for Java mapping ?

    Hi Guys,
    I am developing a java mapping by using Eclipse. I want to know <b>where can i find the jar files of xi which i need to import into Eclipse to develop the Java Mapping</b>.
    I need to use the external jar files for this Java Mapping and once i am done with the mapping, <b>How can import the external .jar files into XI</b>
    any hep would be really appreciated
    Thanks,
    srini

    Sri,
    check <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions's XI FAQ</a> for the location of .jar of mapping API.
    <b>5. Where can I find aii_map_api.jar to create my Java mapping?</b>
    After you have created your java mapping class, export your project to a .jar file and import this .jar into Imported Archives (under Mapping node) in Integration Repository.
    Regards,
    Henrique.

  • How import policy file with Java Web Start

    hi everybody,
    I wrote an application launched by Java Web Start.
    This application encrypt data on the client side and POST them to the server.
    To encrypt I use JCE packages including sunjce_provider.jar, jce1_2_1.jar and
    local_policy.jar and US_export_policy.jar.
    local_policy.jar and US_export_policy.jar are not packages, each of them contains
    a policy file.
    When I test encryption on local no problem, but when I test with Java Web Start
    I've got this exception :
    java.lang.ExceptionInInitializerError:
    java.lang.SecurityException: Cannot set up certs for trusted CAs
    It's because the application launched by Java Web Start doesn't find local_policy.jar
    and US_export_policy.jar.
    There's a problem in my JNLP file :
    <jnlp spec="1.0+" href="http://myserver/sources/test.jnlp" codebase="http://myserver/sources">
         <information>
              <title>Java Web Start TEST</title>
              <vendor>NLE Intech</vendor>
              <description>cryptage then upload</description>
         </information>
         <security>
              <all-permissions/>
         </security>
         <resources>
              <j2se version="1.3" />
              <jar href="sunjce_provider.jar" />
              <jar href="jce1_2_1.jar" />
              <jar href="local_policy.jar" />
              <jar href="US_export_policy.jar" />
         </resources>
         <application-desc main-class="HelloWorldSwing" >
              <argument>c:\myfiletoencrypt</argument>
         </application-desc>
    </jnlp>
    thank you for your answer

    Hi Nicolas,
    If you migrate to JDK1.4 and use the signed Bouncy JAR, you could resolve the problem,
    if you don't want to use unlimited cryptography.
    See my posting on your other question.
    Agnes
    PS. There is a mistake in my other reply, the "local_policy.jar" and the other files must have
    to go into JRE/LIB/SECURITY directory

  • Best way to find and copy files

    If i have a list of 2000 file names and want to find:
    if they exist in folder x
    then copy to folder y
    else
    output an error messege to txt file.
    What would the most efficient way to do this be? So far i've used listFiles() and put a >HUGE< directory listing into an Array. Then I did a comparison for each file name in the list against the array. I know this cant be the most efficient way. I posted earlier in the board but for some reason NO one answered. Can anyone suggest and easier way to do this? and what is the best way to copy files in java? opening a bufferwriter etc? Essectially, im doing a restore from multiple backup directories to the original directory. Please help me if you can take the time.
    Thank you,
    jon

    If i have a list of 2000 file names and want to
    find:
    if they exist in folder x
    then copy to folder y
    else
    output an error messege to txt file.
    What would the most efficient way to do this be?In a loop just read and write each file. If it does not exist, print an error.
    So far i've used listFiles() and put a >HUGE< directory listing into an Array. A directory with a million entries is a HUGE directory, I guess you only have a few thousand.
    I wouldn't bother reading the files into memory, you only need 2000 of them.
    Then I did a comparison for each file name in the list against the array. The OS will do this for you when you try to open the file, which you will have to do anyway to copy it.
    I know this cant be the most efficient way. More efficient way, don't do it at all.
    I posted earlier in the board but for some reason NO one answered. Perhaps the problem seemed too obvious.
    Can anyone suggest and easier way to do this?
    and what is the best way to copy files in java? Copy one at a time.
    opening a bufferwriter etc? Read a block of say 64K at a time. No buffers required.
    Essectially, im
    doing a restore from multiple backup directories to
    the original directory. Please help me if you can
    take the time.If you are recovering from a backup, the most important thing is ensuring the data is correct and valid, speed is less important. (It is no good if it is fast but corrupt)
    Coping 2000 files is going to be only as fast as your drive(s) can handle. How you copy the file is less important.

  • Itunes allows library to point to other folders and not copy files - WHY DOESN'T iPHOTO?

    Hopefully Terence Devlin and other experts will see this. I really am intrigued as to iphoto behaviour and seek some clarification.
    I just waded through 13 pages of an old thread that was locked where Terence kept saying iphoto was all one needed to work with one's photos and kept getting called on the fact he would not answer the question "where are my photos" (photos = files) because it was so darn dangerous for anyone to touch the actual files in the iphoto library.
    I have a use case I need help on and an example of Apple's utter inconsistency here.
    Inconsistency: iTunes lets me create a library all the while pointing to the original files that *I* have imported and structured in a given directory/folder stucture.  Yes it means I manually manage what is in itunes etc, but that's how I like it. The key thing is that itunes allows the choice to import (copy) files (which makes duplicate and doubles hard disk usage) or not.
    iphoto does not allow that option.
    I just converted to Mac from a PC and copied in over 100gb of photo files - some 16,000 photos. I import new pics to the Mac using Canon native software and store them accoring to a structure/taxonomy that *I* determine and want to control - not some software's predetermined idea of events or locations or whatever.  In itunes I can make 'music' an 'audiobook' or I can make a podcast 'music', I can edit the metadata to order things in the 'library' as *I* choose and the itunes library is coole with this without havign ANY of the soruce files in its library. Naively, I thought iphoto would follow a similar philosophy.
    Use case: I discovered that iphoto has some very effective functionality for management of my uploads and sets etc in Flickr, but to do so I have to import my pics, obviously. So I did import the whole 'Pictures' folder - not for a moment considering that Apple would be dumb enough to copy every pic and make a duplicate, or that I might not get the chance to say yes or no to this in the settings, as per itunes.  Having looed for that optin and failed to find it I imported anyway to see what happened. After I realised that the Mac was heating up and files were being copied and I was going to lose another 100+gb of disk space I forced this to quit.  And thanks to others on that other thread I found the iphoto library and deleted the whole thing, getting back 100bg of drive space. All I want to do is use iphoto for the Flickr sharing/management functionality - I have no use for it otherwise. 
    Why would Apple think that not having to duplicate files is ok for itunes but not a viable option for iphoto? Why would I want to double the disk space used for every photo I store? At the very least iphoto needs to come with a health warning that it should only be used to import from external devices and be the sole manager of photos, unless one wants to use double the disk space.
    So if I want to use the sharing (i.e. Flickr uploading and management of sets etc) capabilities, should I import all or some of my folders, do my work and then delete the library each time to reclaim the disk space?

    If I import photos to iPhoto, the originals are deleted? So if I import from a card I have taken from my camera or if I connect my camera directly, the act of importing into iPhoto wipes them from my card?
    Again, you need to check your facts before getting indignant. This is simply not true. It's an option you have and not one I recommend using. But it's only an option.
    Storage costs money and I do not want to have two copies of every pic on my hard disk - especially given huge filesizes of RAW files today.
    No one is suggesting that you have two copies. You have your iPhoto Library and then you back that up. Again, less indignnation, more careful study.
    I do use other photo managers (e.g. native Canon tools) quite happily and they are far less 'exclusive' - i.e. I can use different apps with the same native file structure.
    Using other photo managers makes little sense, any more than having two address books. How do you keep them in sync. Your comment about file structure is important, we'll come back to that.
    If I want to go back to a Windows PC or any other machine and want to retain the "manual" file labelling and directory structure that I have implemented and been using for years, it seems that having a reference library that *I* know the taxonomy of is actually an advantage if I want to go somewhere else.
    If you want to retain exactly the same filing structure you have now, then don't use any Photo Manager. Stick to the file manager. You'll be missing out on a lot of options, but hey ho, it's what you want.
    That said, if you want to migrate from iPhoto to a Windows Machine then that's what File -> Export is for, and you can export from iPhoto to a folder tree matching your Events.
    And this is a big one: This is true of any Photo Manger. Especially one with lossless processing - iPhoto, Aperture, Lightroom et al.
    Here's the principle: IT IS MY DATA AND I WILL DECIDE HOW IT IS LABELLED - WHAT THE FILENAMES ARE - AND HOW IT IS STRUCTURED INTO DIRECTORIES AND SUB-DIRECTORIES.  I WILL DECIDE WHICH APPLICATION I USE TO DO ANYTHING WITH THAT DATA AT ANY POINT IN TIME
    DId you stomp your foot while writing those block capitals too?
    But here's the thing: It's your data then why the heck are you dealing with Files?
    This is the key difference, and frankly, unless you can geet this you're always going to have problems with Photo Mangers.
    The illustration I use is as follows: In my iTunes Library I have a file called 'Let_it_Be_The_Beatles.mp3'. So what is that, exactly? It's not the song. The Beatles never wrote an mp3. They wrote a tune and lyrics. They recorded it and a copy of that recording is stored in the mp3 file. So the file is just a container for the recording. That container is designed in a specific way attuned to the characteristics and requirements of the data. Hence, mp3.
    Similarly, that Jpeg is not your photo, it's a container designed to hold that kind of data. iPhoto is all about the data and not about the container. So, regardless of where you choose to store the file, iPhoto will manage the photo, edit the photo, add metadata to the Photo but never touch the file. If you choose to export - unless you specifically choose to export the original - iPhoto will export the Photo into a new container - a new file containing the photo.
    See? It's about the data and the data and the file are not the same thing. Organising your photos based on the files is like organising a shoestore based on the boxes and not the shoes.
    And here's the thing: anything you want to do with your Photos can be done either with or via your Photo Manager.
    And again, I strongly stress, this is true of iPhoto, Aperture and Lightroom.
    And please note: either with or via... Want to use a 3rd party editor, that can be done easily and so on.
    Let me correct you. "If you use an APPLE Photo Manager then it's the go-to app for whatever you do with your photos.
    Doesn't matter who makes it.
    Other Photo Managers may have more flexibility and enable greater user control."
    Sure. iPhoto's a $15 app. Aperture is a $70 one. Adobe's Lightroom is about $150. Pay more get more options.
    And remember where we came in here: You said you weren't able to choose where to store your files. You're wrong. You can. All I'm saying is that there's no point and more work to it.
    For many - including me - the Apple way seems way too dictatorial -
    Whoa. Apple are dictating nothing. You don't have to use iPhoto, you don't have to use a Mac. And remember:
    ...where we came in here: You said you weren't able t choose where to store your files. You're wrong. You can. All I'm saying is that there's no point and more work to it
    Are Ford dictatorial demanding you steer the car using a wheel? Sheez.
    and yes there are certainly advantages for some types of users of trusting one piece of software to do everything, however non-transparent it may be what it is doing or why, and with the dangers of trying to do ANYTHING else at all with one's photos.
    And again, everything is quite transparent if you take a little while to understand it. You don't understand it because you're coming from a file management  and not a data management perspective. Also no one is suggesting using "one piece of software to do everything". iPhoto leverages the Finder for storage, QuickTime for display, uses and Open-Source database and so on, it protects your original file like a digital negative.
    iPhoto may well not be the app for you. That's especially true since you don't understand it and are confusing it with a file manager. That's fine. But please, stop saying things that aren't true.

  • Can't import .jpg files from iPhoto Library

    What is the meaning of the error message I invariably get when attempting to import a photo file? It goes like this:
    "The file could not be imported: The file “Macintosh HD/Users/alex/Pictures/iPhoto Library/Originals/2006/20060415 To Aigina with grandad and grandma/DSC04837.JPG” can’t be imported; QuickTime couldn’t parse it: -2048"
    Many thanks, people.

    One more thing: I went into iPhoto's preferences, in Advanced, and checked the first option (Importing: Copy files to iPhoto Library folder when adding to library). I then added one photo to the library.
    Then, from iMovie, I selected that newly added photo and bam! it was in! So, I guess, iMovie can't handle correctly iPhoto Library photos if they have not been copied into the iPhoto Library folder structure, correct? Is that what the expected behavior of iMovie HD should be? or a bug to be addressed in future upgrades?
    Many thanks, as always.

  • How to copy a file from Java code

    I have written a file through Java code in folder, say, "A". Now, I want a copy of that file exactly the same in some other folder "B". How, it can be done?

    http://java.sun.com/docs/books/tutorial/essential/io/streams.html

  • Copy files on import greyed out

    Hi I am testing PSE10 on Mac Lion before buying and one thing is stopping me buying it at the moment.  I want my original files to stay where they are and not copied into the PSE library.  Upon getting photos from folders option there is a "copy files on import" which is ticked, aha I thought just take the tick out but it is greyed out - can anyone help ?
    Thanks

      If you are also using iPhoto; Elements will make copies to your hard drive to prevent corruption of the photo Library. The choice is Organizer or iPhoto to manage your images or you can use iPhoto together with the Elements Editor; in which case you need to set Elements as your external editor within the iPhoto settings.
     

  • I need to create  .pst  ext . file using java,whi will import in ms outlook

    {color:#ff0000}*I need to create .PST extension file using java which will be able to import in ms outlook,and that .pst file will contain root folder (like Personal Folders) and inbox,sent mail*{color}
    give me some hint It is essential task .we have to implement code in  java

    I'm using the thin drivers.
    The answer to your question is no, you do not need to create a DSN to connect to Oracle. The Oracle thin driver is all that is required. Your code looks OK to me, I'm assuming that you xxx'd out the IP, and that you are using a real IP in the actual code.
    The message you got back is pretty generic, but can indicate that the Oracle database listener isn't available. Perhaps the database is on a different port, or perhaps the listerner isn't running. Perhaps you have the IP address wrong.
    So, to be very basic:
    1) Can you ping the server you are trying to connect to? This makes sure you are using a valid IP address.
    2) Can you connect to the Oracle server from an Oracle client? This makes sure the listener is running properly, and that you know the correct port number and login information (The port number could be in a local or server based TNS file, or available through an Oracle names server. You might try using the program tnsping if it is available on the client for validation.
    3) If you can do 1 and 2, then be sure you are using the same connection parameters (server, port userid and password) that worked with 2.
    4) Verify that you are using (pointing to) the correct set of Oracle classes for the thin connection. This can be tricky if you have different versions of Oracle on the client then on the server, but is documented on the Oracle website.
    5) If everything checks out, you might want to verify that you are using the most recent versions of the thin drivers, including the Oracle patches.
    Hope it helps - good luck,
    Joel

  • In iMovie is there any way when you import your files to just make the file an alias like final cut does and not actually import and copy the whole file again into my mac. It's taking a lot of my space up. Thanks

    I just want to see if there is any way that I can import the files into iMovie as an alias like Final Cut Pro and Express does. I hate having to copy the file again because it takes up alot of space on my Mac. Thanks.

    No, but you can import your Event to an external drive from the import screen.
    It is also possible to create a symbolic link to another location. The link stays in your iMovie Events or iMovie Project folder, but the actual file resides somewhere else. I don't do it this way, so I can't share any details.

  • How to turn off "Copy Files on Import"

    I'm new to Photoshop Elements 9 and the Organizer.  I'm trying to import my pictures into the organizer but I don't want to copy the file from the network drive to my local Macbook hard drive.  Unfortunately I can't figure out how to turn off the "Copy Files on Import" checkbox.
    From within the Organizer I am selecting:
    File -> Get Photos and Videos -> From Files and Folder
    This opens a Finder window and I can navigate to the network drive, select the source folder, and select the files I want to import.  I just can't seem to figure out how to disable the "Copy Files on Import" option.  Is there something in Prefences that I need to change to allow me the option?
    Thanks,
    Vince

    From the PSE9 help :
    Add files from specific folders
    In the Elements Organizer, from the Display menu, select Folder Location.The folder hierarchy panel opens on the left side of the Media Browser.
    In the folder hierarchy panel, browse to the folder containing the files you want to import.
    Right-click/Control-click the folder, and choose Import To Organizer.The Getting Photos dialog box will report whether files were imported.
    Click OK.
    If files were imported, the folder’s icon changes from an Unmanaged Folder icon to a Managed Folder icon .

Maybe you are looking for