Reading file from a folder : File dir = new File(URL+aFile_to_add);

Hi,
Trying to read files from a dir on my site using a JSP and bean. I've tried nearly every option for the filepath I can think of and it doesn't seem to be finding the file...
Here's the bit:
String URL = "images\\wedding_photos\\";
File dir = new File(URL+aFile_to_add);
String[] files = dir.list();
It's working locally, but I obviously had to change the path from c://... to the above.
The full code is listed below in the addWedding Method
The method removes the .jpg from the file name and then writes the new file name to a database
Thanks for any insight.
Regards
Jim
public String addWedding(String aFile_to_add)
String feedback = "unset in scrubWedding";
try
String URL = "images\\wedding_photos\\";
Class.forName("org.gjt.mm.mysql.Driver");
java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:mysql://localhost/rhwedd2_shop?user=**********&password=*******");
java.sql.Statement statement = connection.createStatement();
File dir = new File(URL+aFile_to_add);
String[] files = dir.list();
if (files == null)
feedback = "Sorry, couldn't find the file "+aFile_to_add+"...no files have been added.";
else
for (int i=0; i<files.length; i++)
// Get filename of file or directory
String filename = files;
String no_extension;
//convert string array element into a char array
char [] charsfilename = filename.toCharArray();
int newlength = charsfilename.length -4;
no_extension = String.valueOf(charsfilename,0,newlength);
filesAdded = filesAdded+", "+no_extension;
// Show the new file names in stack trace without extension
//System.out.println("String no_extension " + no_extension );
statement.executeUpdate("INSERT INTO items VALUES ('"+no_extension+"',5,'"+aFile_to_add+"')");
// write to table with item_id and weddingid
feedback = "The following files have been added..."+filesAdded;
if (statement != null )
statement.close();
if ( connection != null )
connection.close();
catch(Exception e)
feedback = "Into the catch";
e.printStackTrace(System.err) ;
return feedback;
}//end addWedding

String URL = "images\\wedding_photos\\";
File dir = new File(URL+aFile_to_add); ok, ok, I'll answer...
1) What gives you the impression that the relative directory "images\\..." exists (or, in other words, what makes you think your current directory is the parent of "images"?

Similar Messages

  • Reading a file from a folder.

    Hi everyone,
    I am trying to modify my first java program.
    The method below is used to read a file that is hard coded in the below method. What I would like it to do is to pick up files that are stored in a folder. The reason for this is that the file names will never be the same.
    I am unsure how to do this and would appreciate some help from you.
    Thanks in advance.
    public void fileBreakdown()
              try
                   FileReader file = new FileReader("files/myTextFile.txt");
                   BufferedReader buffer = new BufferedReader(file);
                   String textline = null;
                   ArrayList arr =  new ArrayList();
                   while ((textline = buffer.readLine()) != null)
                        boolean syswarnEndFound = false;
                        if((textline.substring(45, 52)).equals("SYSWARN"))
                             System.out.println(textline.substring(45, 52));
                             arr.add(textline);
                             while ((textline = buffer.readLine()) != null && !syswarnEndFound)
                                  if(textline.indexOf("}") == -1)
                                       //System.out.println("not found : " + textline);
                                       buffer.mark(1000);
                                       arr.add(textline);
                                  else
                                       //System.out.println("found");
                                       syswarnEndFound = true;
                                       buffer.reset();
                                       OutputFileTypes.processSYSWARN(arr);
                        else if((textline.substring(45, 51)).equals("SYSMSG"))
                             System.out.println("Stopped, program ends");
                             System.out.println(textline.substring(45, 51));
                             arr.add(textline);
                             while ((textline = buffer.readLine()) != null && !syswarnEndFound)
                                  if(textline.indexOf("}") == -1)
                                       buffer.mark(1000);
                                       arr.add(textline);
                                  else
                                       syswarnEndFound = true;
                                       buffer.reset();
                                       OutputFileTypes.processSYSMSG(arr);
                        else
                             String[] messageArr = textline.split(" ");
                             Processing.whichFileType(getSubject(messageArr),getMessage(messageArr),getPublishedDate(messageArr));
                             getPublishedDate(messageArr);
                   buffer.close();
              catch( IOException e) {System.out.println(e);}
         }

    I could not compile your code. But if you wanted to get all .txt files from a folder then you could do something like this
    class EndsWith implements FilenameFilter {
         String ext;
         public EndsWith(String ext) {
              this.ext = "." + ext;
         public boolean accept(File dir, String name) {
              return name.endsWith(ext);
         public static void main(String args[]) {
              String srcDir="C:/temp/";
              try {
                   File srcFiles = new File(srcDir);
                  FilenameFilter filteredFiles = new EndsWith("txt");
                  String sourceDir[]=srcFiles.list(filteredFiles);
                  for(int i=0;i<sourceDir.length;i++)
                       String fileName = srcDir+sourceDir;
              System.out.println(fileName);
              FileReader file = new FileReader(fileName);
              //..your code here
              }catch(IOException ioe) {
                   ioe.printStackTrace();
    NOTE: I haven't tested this code. You can give a try.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How use PHP to read image files from a folder and display them in Flex 3 tilelist.

    Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
    PHP :
    PHP Code:
    <?php
    //Open images directory
    $imglist = '';
    $dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "filename: " . $file . "\n";
    $dir->close();
    ?>
    FLEX 3 :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.rpc.events.ResultEvent;
    public var image:Object;
    private function resultHandler(event:ResultEvent):void
    image = (event.result);
    ta1.text = String(event.result);
    private function faultHandler(event:FaultEvent):void
    ta1.text = "Fault Response from HTTPService call:\n ";
    ]]>
    </mx:Script>
    <mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
    <mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
    <mx:HTTPService id="pic" url="{phpPicture}" method="POST"
    result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
    <mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
    <mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
    </mx:Application>
    Thanks. Need help as soon as possbile. URGENT.

    i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
    PHP Code:
    <?php
    echo '<?xml version="1.0" encoding="utf-8"?>';
    ?>
    <root>
    <images>
    <?php
    //Open images directory
    $dir = dir("images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
    //$dir->close();
    ?>
    </images>
    </root>
    Flex Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="callPHP();">
    <mx:Script>
    <![CDATA[
    import mx.rpc.http.HTTPService;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var arr:ArrayCollection = new ArrayCollection();
    private function callPHP():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Picture.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    arr = event.result.root.images.image as ArrayCollection;
    private function faultHandler( event:FaultEvent ):void
    Alert.show( "Fault Response from HTTPService call:\n " );
    ]]>
    </mx:Script>
    <mx:TileList id="tilelist"
    dataProvider="{arr}">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Image source="images/{data}" />
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

  • Error While reading an Excel file from KM Folder.

    Hi Guru's,
    In my PDK Application I am trying to read an Excel file from KM Folder.
    Workbook workbook = Workbook.getWorkbook(new File("/irj/go/km/docs/documents/test/Test.xls"));
    It gives an error:
    Error:java.io.FileNotFoundException: \irj\go\km\docs\documents\test\Test.xls (The system cannot find the path specified)
    Details of appli:
    In my JspDynpage I am calling a utility Java file.
    There I have to read an  Excel and to passit to JSP.
    Details of jar files  used:
      jxl-2.6
      com.sap.security.api.jar
    Regards,
    Ram

    Hi,
    You are trying to read file wrong way. In the tutorial of Java Excel Api: "JExcelApi can read an Excel spreadsheet from a file stored on the local filesystem or from some input stream.". You are trying to read from file system. So you must get file input stream then you can read it. Please search forums KM file read.

  • I want to make a schedular which read xml files from a folder ,import in Indesign template then export as a pdf....

    i want to make a schedular probably in Coldfusion or using javascript ,  which read xml files from a folder ,import in Indesign template then export as a pdf....

    I don't think you understand: I want to open Dreamweaver and build a brand new site, then when I am done I want to host the dreamweaver site on the Business Catalyst platform. I dont want to use anything in BC to build the site, I just want to use the hosting platform. I do not want to import a BC site into dreamweaver or anything like that. I just want to use BC the same way I would use godaddy, or uhost or any other hosting provider. Based on your response you said that "of course its possible to build a BC site in Dreamweaver" I dont want to build a BC site, I want to build a Dreamweaver site and host it on the BC platform. Like I said before it doesnt seem like this is possible. As of now we can only build a new site in MUSE and integrate it into BC without using a BC template. Can you understand what I am saying. I DONT WANT TO USE A BC TEMPLATE, I WANT NOTHING TO DO WITH BC WHILE I AM BUILDING THE SITE WITH DREAMWEAVER, JUST LIKE MUSE DOES.

  • Reading in files from a folder

    Hiya, i have a folder of .txt files i want to read in, i can read it single txt files when i specify the name of it, but i want to be able to automatically read ALL text files within a folder, so read one in, perform some processing on it, then move to the next one, till all present folders have passed through. is this possible?
    thanks
    dori

    Try this. This is probably what you want:
    import java.util.*;
    import java.io.*;
    public class Test
      public static void main (String args []) throws Exception
         File dir = new File ("c:\");
         readFiles (dir);
      public static void readFiles (File file)
         if (file.isDirectory ())
              String [] exts = {".txt"};
              FileNameFilter fileNameFilter = new FileNameFilter (exts);
              File [] children = file.listFiles (fileNameFilter);
              for (int i=0;i < children.length;i++)
                   readFiles (children );
         else
              // Process the file here
              System.out.println ("Processing File : " + file.getPath ());
         static class FileNameFilter implements FilenameFilter
              private String [] extensions = null;
              public FileNameFilter (String [] exts)
                   extensions = exts;
              public boolean accept (File dir, String name)
                   File tmpFile = new File (dir.getPath () + "/" + name);
                   if (tmpFile.isDirectory ()) return true;
                   if (extensions == null) return false;
                   name = name.toLowerCase ();
                   for (int i=0;i < extensions.length;i++)
                        if (name.endsWith (extensions [i])) return true;
                        //if (name.endsWith (".jpg")) return true;
                   return false;

  • How to read the file from a folder.

    Hi All,
    How to read the file from a folder or directory from the non sap server / remote server.
    Regards
    Sathis

    open dataset filename for input in text mode
                         encoding default.
    filename is character type variable with the destination filename.
    Edited by: Jino Augustine on Apr 19, 2010 1:31 PM

  • Importing All the files from a folder at a time

    Hi....
    Can any body tell me how to import set of files from a folder into IDM.
    It is becoming very difficult to import the files one after other....
    Waiting for Reply....
    Thanks in advance..........

    We used an ant script to build an XML file that will contain the files. The script is configured to use the folder structure of our CVS repository.
    We'd checkout our XML module and then run the build script and import the resulting init file.
    Code to the script is below -- caveat emptor. You'll need to change the folder structure to suit your own environment.
    <?xml version="1.0" encoding="UTF-8"?>
    <project basedir="." default="all" name="MyInit">
        <target name="init">
            <property location="." name="src.dir"/>
            <property location="." name="dest.dir"/>       
            <property name="project.name" value="${ant.project.name}"/>
            <property location="${dest.dir}/MyInit.xml" name="MyInit.output"/>
            <property name="source.configuration" value="${dest.dir}/configuration"/>       
            <property name="source.emailTemplate" value="${dest.dir}/emailTemplate"/>
            <property name="source.forms" value="${dest.dir}/forms"/>
            <property name="source.reports" value="${dest.dir}/reports"/>               
            <property name="source.resource" value="${dest.dir}/resource"/>          
            <property name="source.rules" value="${dest.dir}/rules"/>
            <property name="source.workflow" value="${dest.dir}/workflow"/>
            <!-- get the source path -->
            <path id="configuration.path">
                <fileset dir="${source.configuration}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="cp" refid="configuration.path" />
             <path id="emailTemplate.path">
                <fileset dir="${source.emailTemplate}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="ep" refid="emailTemplate.path" />
             <path id="forms.path">
                <fileset dir="${source.forms}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="fp" refid="forms.path" />
            <path id="reports.path">
                <fileset dir="${source.reports}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rptp" refid="reports.path" />                 
            <path id="resource.path">
                <fileset dir="${source.resource}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rep" refid="resource.path" />        
            <path id="rules.path">
                <fileset dir="${source.rules}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="rp" refid="rules.path" />
            <path id="workflow.path">
                <fileset dir="${source.workflow}" >
                   <include name="*.xml" />
                </fileset>
             </path>
             <property name="wp" refid="workflow.path" />
            <!-- get the path prefix -->
             <path id="source.path">
                <pathelement location="${src.dir}" />
             </path>
             <property name="sp" refid="source.path" />       
        </target>
        <target depends="init"  name="win_init">
            <!-- change the path of xml files to windows path -->
            <property name="importfile.path" value="${sp}"/>                            
        </target>              
        <target depends="init" name="make">
        <!-- using XML character entity references to escape
        <  <
        >  >
        '  &apos;      -->    
            <echo file="${MyInit.output}" append="false"><?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE Waveset PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <Waveset>
    ${cp}
    ${ep}
    ${fp}
    ${rptp}
    ${rp}
    ${wp}
    </Waveset>
            </echo>
         <!-- replace path prefix with ImportCommand -->
         <replace file="${MyInit.output}"
                  token = "${sp}"
                  value = "<ImportCommand name='include' file='${importfile.path}" />
         <!-- deal with file and path separators in an os independent way -->
         <replace file="${MyInit.output}"
                  token = "${file.separator}"
                  value = "/" />        
        <replace file="${MyInit.output}"
                  token = "${path.separator}"
                  value = "${line.separator}" />
        <replace file="${MyInit.output}"
                  token = ".xml"
                  value = ".xml'/>" />
        </target>
        <target depends="init,win_init,clean,make" description="Build everything." name="all"/>
        <target depends="init" description="Clean all build products." name="clean">
            <delete file="${MyInit.output}"/>
        </target>
    </project>

  • How to Copy an Image File from a Folder to another Folder

    i face the problem of copying an image file from a folder to another folder by coding. i not really know which method to use so i need some reference about it. hope to get reply soon, thx :)

    Try this code. Make an object of this class and call
    copyTo method.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class FileUtil
    extends File {
    public FileUtil(String pathname) throws
    NullPointerException {
    super(pathname);
    public void copyTo(File dest) throws Exception {
    File parent = dest.getParentFile();
    parent.mkdirs();
    FileInputStream in = new FileInputStream(this); //
    Open the source file
    FileOutputStream out = new FileOutputStream(dest); //
    Open the destination file
    byte[] buffer = new byte[4096]; // Create an input
    buffer
    int bytes_read;
    while ( (bytes_read = in.read(buffer)) != -1) { //
    Keep reading until the end
    out.write(buffer, 0, bytes_read);
    in.close(); // Close the file
    out.close(); // Close the file
    This is poor object-oriented design. Use derivation only when you have to override methods -- this is just
    a static utility method hiding here.

  • Is it possible to pickup a specific file from a folder?

    Hi
    I am wondering whether it is possible to pick a specific file from a folder. I have a shape where I have got a filename and I need to look for it in a folder.
    Is that possible?
    And how can I achieve this? The next step is to pick the file up and transfer it to another location. So basically in pseudo code I need to ask my defined folder with a filename as parameter. Get the file and move it to another folder.
    Suggestions are most appreciated. Thanks

    Assuming you are using orchestration, you could
    create an assembly, install it in the GAC, add a reference to it in your BTS
    project, and call it from an Expression shape to resolve the receive
    location. You would only really need one static method in a class. Be sure
    to add a reference to Microsoft.BizTalk.ExplorerOM.dll.
    Example:
    using Microsoft.BizTalk.ExplorerOM;
    namespace Phil
    public class OrchestrationHelpers
    public static string ResolveReceiveLocationName(string
    inboundTransportLocation, string receivePortName)
    BtsCatalogExplorer bts = new BtsCatalogExplorer();
    bts.ConnectionString =
    "SERVER=localhost;DATABASE=BizTalkMgmtDb;Trusted_Connection=True;Network
    Library=DBMSSOCN;"
    foreach (ReceiveLocation location in
    bts.ReceivePorts[receivePortName].ReceiveLocations)
    if (location.Address == inboundTransportLocation) return location.Name;
    return null;
    In your Expression shape within your orchestration, assuming a message
    called "MyMessage" and a string variable "receiveLocationName":
    receiveLocationName =
    Phil.OrchestrationHelpers.ResolveReceiveLocationName(MyMessage(BTS.InboundTransportLocation),
    MyMessage(BTS.ReceivePortName));
    If this post answers your question, please mark it as such. If this post is helpful, click 'Vote as helpful'.

  • How can I move a Pages file from a folder to another one?

    I Have done the upgrade to mac os Yosemite but now i'm Not able to move a file from a folder to another one Inside iCloud
    now it's impossible to organize MY archive

    Thankyou Winston, you guess right. What i don't understand is why with the older version of mac os (10.9) i can organize my document into icloud folders using the Pages app window. But now with the new version i'm no longer able to do that. Using ipad in the same window there is no problem, but in mac os it doesn't work. 

  • Move files from one folder to another

    I am brand new to the application and have spent a ton of time googling various topics, but need some additional help. Seems easy enough, but I can't figure out how to do it...
    I would like to move pics from one folder to another. I can drag files from one folder to another, but they still reside in the original folder as well. Is there a way to cut and paste or a similar function to accomplish this move?
    Thanks.

    Hey, HawaiianHaole, as a multidecade Mac user, let me tell you, Aperture is about the worst example of Mac-iness one could imagine. Ironic, as it's (of course) made by Apple. But it is so inflexible, and insists so vociferously on making the user learn its peculiar interface conventions it reminds me most of something out of that famous company in Redmond.
    Want your Projects in an order you choose? Sorry! Want to arrange your windows so you can see your list of chat buddies while you're working in Aperture? Nope, can't do it! Aging eyes have trouble reading tiny grey type on a grey background? Hey buddy, it was your choice to grow old, don't blame us!
    But all is not lost. Aperture has gotten considerably better of late (versions up to 2.0 were fundamentally unusable in many ways) and will hopefully continue to improve. (ie Maybe they'll fix the printing thing...)
    Please don't make Aperture the basis for your judgement of the Mac OS. Many long time Mac users are having as much trouble with Aperture as you. Mac OSX has significantly reduced customizability but at the benefit of much improved stability and indeed usability. Old school Mac users had to learn to accept this, which most did. You'll hear people talk about the "Way of the Steve". As irksome as Aperture can be, you'll actually have a better time of it if you adopt the Way of the Steve, and accept that you can't do things the way you might want to. This is imho antithetical to the original Mac many of us knew and loved, but it's the way things are today, so we mostly shut up and take it. You can fight with your software all day, or just accept that there are ways you have to adopt and adapt to them.
    Welcome to the Bright Side, hope your Mac experience improves.

  • How can I import Quicken Files from a G4 to a new iMac.

    I need to transfer my Quicken 2007 files from my G4 to my new iMac. My G4 is running OS 10.4 and Quicken Essentials for Mac requires 10.5 or above. My G4 cannot run 10.5. My iMac is running Lion and I've heard if I load Mac Essentials on my iMac, I won't be able to import the files from my G4. Anybody have any ideas?
    I've been considering making a copy of my system and applications folders on an external firewire drive, then connecting it to my iMac. I thne plan to use the external drive as a startup disk and load Quicken essentials on the external drive. Then, once eveything is loaded, I was hoping I could copy the files and pull them over to my applications folder on my iMac. Does anybody know if that will work?

    I'm in the same boat!!! Been a long Time Quicken user and they finally made the software almost un-useable. I have 2 intel laptops in the house and a G4. The intel systems are both running Lion had I known the quicken conversion software dosen't run on Lion I would have converted all my quicken backups (going back to 1997) before installing Lion.
    To answer your question, what I have found out is convert all your files on Lepoard then update to lion. The conversion software that comes with Quicken Essentials will work on Lepoard. Thats how I converted mine. But last week I needed to go back to and old backup looking for some transactions and found the Lion issue. Had to boot up the G4 and load the old Quicken software to look at the backups.
    Been really thinking of switching to another product.

  • Got a new external hard drive. Transferred all files from old hard drive to new hard drive. Connected hard drive to macbook. How do I get all my files to be recognized by iTunes and my already made playlists??

    Got a new external hard drive. Transferred all files from old hard drive to new hard drive. Connected hard drive to macbook. How do I get all my files to be recognized by iTunes and my already made playlists??

    Trying to download photos from IPHONE, IPAD to IPHOTO in IMAC after installing new hard drive.
    How did you import the photos to iPad and iPhone?
    If the photos have been synced to the iPhone and iPad using iTunes, you cannot sync them back.
    See this document:  http://support.apple.com/kb/HT4236
    You can't reimport pictures synced from your computer to your device back to your computer. You can only import pictures in the Camera Roll or Saved Photos from your device to your computer. If you need to retrieve synced photos from your device:
    If your photos are not in the Camera Roll on your devices, save them to the Camera Roll, share them to the Photo Stream, mail the photos, or, if you have iPhoto on the devices, use iTunes Photo Sharing.
    http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnkee26bc1
    Save photos to your computer using iTunes
    Connect your iOS device to your computer.
    Tap a photo, album, event, web journal, or slideshow and tap Share> iTunes.
    Tap Selected, or change the photos you want to save (if you are saving a slideshow skip to step 4):
    Select different photos: Tap Choose Photos, tap one or more photos, and tap Next.
    Select a range of photos: Tap Choose Photos, tap Range, tap the first and last photos in the range, and tap Next.
    Select all the photos in an album or event: Tap All.
    In iTunes, click the button for your device and click Apps at the top of the window.
    Below File Sharing, select iPhoto (in Apps).
    Select the Shared Photos folder under iPhoto Documents.
    Click Save To and select the location on your computer where you want to save the items.
    To view your photos, go to the Finder and look in the location you selected above.

  • How to move files from one folder to another folder in webdynpro java for sap portal

    Dear Experts,
    I wan to move files from one folder to another folder in SAP portal 7.3 programmatically in webdynpro java.
    My requirement is in my portal 1000 transport packages is their. Now i want to move 1 to 200 TP's into Archive folder.
    Can you please help me how to do in through portal or wd java ...
    Regards
    Chakri

    Hello,
    Do you know what the difference between copying a file this way :
    ** Fast & simple file copy. */
    public static void copy(File source, File dest) throws IOException {
    FileChannel in = null, out = null;
    try {         
    in = new FileInputStream(source).getChannel();
    out = new FileOutputStream(dest).getChannel();
    long size = in.size();
    MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, size);
    out.write(buf);
    } finally {
    if (in != null) in.close();
    if (out != null) out.close();
    ================SECOND WAY============
    AND THIS WAY:
    // Move file (src) to File/directory dest.
    public static synchronized void move(File src, File dest) throws FileNotFoundException, IOException {
    copy(src, dest);
    src.delete();
    // Copy file (src) to File/directory dest.
    public static synchronized void copy(File src, File dest) throws IOException {
    InputStream in = new FileInputStream(src);
    OutputStream out = new FileOutputStream(dest);
    // Transfer bytes from in to out
    byte[] buf = new byte[1024];
    int len;
    while ((len = in.read(buf)) > 0) {
    out.write(buf, 0, len);
    in.close();
    out.close();
    And which is better? I read up on what each kind of does but still a bit unclear as to when it is good to use which.
    Thanks in advance,
    JavaGirl

Maybe you are looking for