Jcifs and folder copy

Hi, I have already find a way to copy a file from th smb server to a local drive, but when I try to cop a folder it won't work. If someone is working with jCIFS and has done this before, it would of great help.
Here is the code i'm using for the file copy.
super.getDestination().createNewFile();
         InputStream in = null;
         OutputStream out = null;
               in = new SmbFileInputStream(this.getSource());
               out = new FileOutputStream(super.getDestination());
               byte[] buf = new byte[1024];
               int len;
               while((len = in.read(buf)) > 0){
                 out.write(buf, 0, len);
           try {
                in.close();
                out.close();
           } catch (IOException e) {
                e.printStackTrace();
           }This code is fully working for a File but not for a folder, if someone has an idea on how to make it work.
Tanks.

Uh, I think you will need to copy the folder recursively, i.e. create the folder, copy all files in the folder, for all subfolders recurse.
BTW - you don't need to call createNewFile on your destination File object. FileOutputStream will do that for you.

Similar Messages

  • Can some please provide instructions on how to import an iPhoto library from an old Mac to a new Mac without getting a bunch of duplicates?  I tried transferring my pictures using an external hard drive and then copying it to the Pictures folder on my Mac

    Can someone please provide instructions on how to import an iPhoto library from an old Mac to a new Mac without getting a bunch of duplicates?  I tried transferring my pictures using an external hard drive and then copying it to the Pictures folder on my new Mac.  I ended up getting a bunch of duplicates. My old Mac has an older version of iPhoto while the new Mac has iPhoto '11.  Is that the cause of the problem?  Please advise.  Thanks.

    Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
    Then launch iPhoto. That's it.
    This moves photos, events, albums, books, keywords, slideshows and everything else.
    Regards
    TD

  • PSE12 Organizer - can you copy photo from one folder to another and import copy into Organizer and still have original in other folder

    I have been using folders to organize all my pictures and I will copy photos from folder to folder, often having them in 2 or 3 folders based on use.  I tried to copy a photo in Organizer PSE12 from one folder to another and you can only move it, that means I can only have one copy of the photo.  That is fine if I am using tags and want to search for it, but I want to have mult copies in mult folders. Organizer will recognize that it is there but it won't import it into the new folder. Until I move it, it stays in the original folder.  I can drag it out of Organizer and drop (copy) it into a new folder fine, but it won't show in organizer in the new folder.  Is there any way to copy and have multiple copies show up in multiple folders?

    Hi,
    The organizer works on the principle of not having multiple copies of the same photo.
    If you have multiple copies spread in different folders, then making changes to one doesn't affect the others. The use of tags and albums are there to give different views of your photos.
    You can't have multiple copies with exactly the same name even if they are in different folders. You could select a photo and duplicate it (File -> Duplicate) and then move the copy into a different folder but the name will be different.
    If you want different folders for a specific reason, it is possible to use albums to collect the group of photos and then export them to a new folder outside of the organizer. You can also rename on export which is useful if you want to arrange the photos in a specific order.
    Hope that helps a bit.
    Brian

  • Tell iphoto to view photos from a predefined folder and not copy them

    Hi!
    I am using iphoto 09 and was wondering if we can tell iphoto to take photos from a particular folder and not copy the photos in its own set of folders. I don't want to have duplicates.
    I already had structured my folders in a certain way and I don't want Iphoto copying them again.
    tanks!

    Best way of working: Recreate your folders in the iPhoto Window and forget about your own.
    Here's a fuller description of a Referenced Library and the perils thereof:
    https://discussions.apple.com/thread/3062728?tstart=0

  • Whenever i send new email or reply to any of my emails, after sending it one copy of sending email i see in my inbox folder and one copy of it in sent folder?

    Whenever i send new email or reply to any of my emails, after sending it one copy of sending email i see in my inbox folder and one copy of it in sent folder?
    I don't want copy of it in any of my Inbox folders as well in unified folders.
    Pls ad.

    Tools (Alt-T) - Account Settings - Copies and Folders
    Is 'Place a copy in Sent folder' checked?
    If so, where does it point to?

  • Jcifs and LDAP

    Hello,
    I�m attempting to authenticate my users using
    <filter>
    <filter-name>NtlmHttpFilter</filter-name>
    <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
    <init-param>
    <param-name>jcifs.http.domainController</param-name>
    <param-value>******</param-value>
    </init-param>
    �..
    I can do it for users from my domain, but we have many users from different domains. I understand that I have to connect to LDAP server of my Domain using port 3268. And after that I will receive the list of all users from all domains. But I don�t know how I can give in web.xml the port of LDAP. In list of jcifs properties I find only property to set local port.
    Thank you in advance.
    Feldman Faina

    Uh, I think you will need to copy the folder recursively, i.e. create the folder, copy all files in the folder, for all subfolders recurse.
    BTW - you don't need to call createNewFile on your destination File object. FileOutputStream will do that for you.

  • I redirected iTunes to an external drive and moved my iTunes library and folder, but my hard drive is still low on space.  How can I be sure that my music is all on the external HD ONLY, especially with the new iCloud technology?

    I redirected iTunes to an external drive and moved my iTunes library and folder, but my hard drive is still low on space.  How can I be sure that my music is all on the external HD ONLY, especially with the new iCloud technology?  It doesn't look like I created any more space by doing this, AND I totally lost all my iTunes playlists.  I'm not sure if because I added old library materials manually if this messed up my playlists, or if the new location is just not reading my moved library.  In any case, I followed step by step instructions and found a few holes and thought I'd just "figure it out" but I guess I'm not as smart as I thought since I'm still scratching my head many hours later.
    Thanks for any support ;-)
    Eaglerocker

    Quick answer if you use iTunes' default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Open iTunes and immediately hold down the option (alt) key (shift on Windows) so you get a prompt to select a library, then guide it to the 'iTunes Library.itl' file in the moved iTunes folder.
    If this is to a new computer and you put the copied iTunes folder in the default location of Macintosh HD > Users > *User Name* > Music  then you don't even need to start with the option key held down, iTunes will automatically look for it there.  (Make sure there isn't anything already in the iTunes folder there that you want to keep since you will be replacing it with the one you are moving.)
    iTunes: How to move [or copy] your music [library] to a new computer [or another drive] - http://support.apple.com/kb/HT4527 - a somewhat bewildering and not always easily understandable set of options.

  • 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.

  • I have a folder and 3 files stuck on my desktop.  When I drag them to the trash I am asked to enter my administrator's password.  I do this but the files and folder will not delete.  I have checked 'Get Info' on each of them and they are not locked?

    I have an empty folder and 3 .jpg files stuck on my desktop.  When I drag them to the trash I am asked to enter my administrator's password.  I do this but the files and folder will not delete.  I have checked 'Get Info' on each of them and they are not locked and I have full read & write access.  Grateful for any assistance in solving this problem.

    Back up all data.
    Triple-click anywhere in the line below to select it:
    ls -@Oaen De* | open -f -a TextEdit
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V).
    A TextEdit window will open with the output of the command. Post the contents of that window, if any — the text, please, not a screenshot. The title of the window doesn't matter, and you don't need to post that.
    If any personal information appears in the output, anonymize before posting, but don’t remove the context.

  • CJR2 entries in version 0 (original) and EFC (copy) show different ? amount

    HI Team,
    Recently we copied data from Version O to Version EFC using T code CJ9F , When running CJ9F to copy V0 to EFC, the work centre rate has updated in Version EFC with the latest from Version  0 , Therefore, the CJR2 entries in version 0 (original) and EFC (copy) show different ? amounts: is this correct?
    My Analysis  on the above  incident between two Versions
    Version EFC
    1.     Version EFC consist  checkedu201D Integrated planningu201D check box 
    2.     Exchange Rate type u201CMu201D ,
    3.     It doesnu2019t consist any u201Cvalue date  u201C 
    4.     checked   u201C integrated planning with cost center / bus. Process.
    Version u201C 0u201D
    Version u201C Ou201D doesnu2019t checked  u201C integrate planning  check box from 2003 fiscal year
    2 . Exchange rate type u201C Pu201D  u201C
    3 .value date u201C 01.04.2003
    4 . unchecked u201Cintegrated planning with cost center / bus. Process
    where is the data corrected can any one guide me and let me know if any steps are missing
    thanks
    Ranamka

    Hi kim standley,
    Thanks for using Apple Support Communities.  I would first try resetting SyncServices as described here:
    Mac OS X: Resetting the SyncServices folder
    http://support.apple.com/kb/TS1627
    If the issue persists after that, I'd move on to this article:
    Sync Services: Advanced troubleshooting for contact and calendar syncing
    http://support.apple.com/kb/ts2481
    Cheers,
    - Ari

  • Aperture 1.5 and folder with . as first letter

    Hi !
    I'm updating Aperture to version 1.5, now it is "Upgrading X of Y projects" but I see that in the left area (where there are the folder and project) go aways all the folder starting with . (point) as first letter that I had before.
    I have used this letter as first to have this folder always "on top" in the list. Now I'm waiting the finish of the process (I think at least one hour) but I have fear for that folders is disappeared... who know something about this?
    bye!
    Max

    I'm trying to find a solution... I have open Terminal and write:
    defaults write com.apple.finder AppleShowAllFiles YES
    and I restart the finder. Now I can see the hidden files.
    I have opened the updated Aperture Library and the folders are gone away... so I have opened the Vault File and I copy from here the .FOLDER into harddisk. Just when finish I try to re-import this folder into Aperture (but I change the name before !)-
    I hope could be useful is somebody is in my situation.
    Max

  • Drag and drop copy can skip some files

    I just got a new iMac with 10.5. I hooked up an external drive (USB) with a copy of my old G4 10.4 drive.
    I have found that if I drag and drop a folder with many files inside to the new machine, most but not all of them get copied. For instance I dragged over my Corel drawer inside my documents drawer into my new machines documents drawer. Well it skipped about 30+ files out of about 500. It skipped one sub folder and other loose files. Once I figured out which files and folders it missed I was able to drag those over again and it worked.
    This is really bad when you are dragging lots of files and trusting it to do them all. No errors or warnings popped up either. I initially noticed it because I was looking for a particular file that did not get copied, then I looked and saw that the # of files in the drawers was different from the original. Had to put old and new side by side to figure out what was missing.
    Anybody heard of this or have a similar problem? Or better yet a solution?
    Thanks!

    I am having the same problem. I just bought a USB Hard-drive and was copying a 2.7 M folder from one HD to the USB and it leaves out like 15 files. I tried copying to the desktop and it does the same thing. I can open the folder, cmd-A, cmd-c, then paste and it took all the files. Very strange.

  • Can't See Files in Folder Copied from External Hard Drive to Desktop

    I recently purchased a Jobo Spectator (portable image tank for storing photos). When I connect it (USB) to my iMac I see it and can copy files to my desktop. If I copy an entire folder from the device to my desktop, Finder tells me it contains 0 files and I can't see any files in it. However, if I try to recopy one of the copied files from the Jobo to the folder, Finder tells me the file already exists there and asks if I want to replace it. If I then cancel the copy, all of my copied files show up in the folder. This behavior seems to be consistent. There is no Mac driver for the device. It doesn't look like I'm going to lose any files from this behavior but I find it frustrating.
    Does anyone have a clue? Thanks.

    A warm welcome to the forums Sue!
    The Finder is a bit lackadaisical about updating itself, you can click back & forth enough times, closing folders, opening folders and eventually it'll be in touch, or you can try something like "A Better Finder Attributes", for it's "force the Finder to update stale information about your files" feature.
    http://www.versiontracker.com/dyn/moreinfo/macosx/18736
    Possibly this would help too, but haven't tried it...
    http://www.finderpop.com/

  • Mac CAN't Cut files and folder???

    i'm new Mac user!
    My Mac CAN't Cut files and folder! is it normal? just copy, then delete orig.
    or use drag with OPT key. But i can't use CMD+X or CUT in EDIT menu.

    I have been having the same problem, and thought it was just me. Had the same problem with deleting files/folders in Finder...till I found you have to hold the cmd key down while deleting.
    Was hoping there was a keyboard shortcut for copy as well.
    Really infuriating, what would be a CMD-X, move mouse, CMD-V operation becomes a copy, navigate to new folder/move to new window, paste, go back to other window, re select and delete operation.
    My work around is to use Windows Explorer in unity mode in VMWareFusion if I am doing any major search/move/cut operations.
    Saves having to have multiple windows open/going back/forwards, between them.
    I did see a terminal hack that enabled the CMD-X keyboard shortcut....but it just deletes to the Trash Bin and does not actually paste the items back.
    Can understand the reasons nerowolfe states, but that does not stop it from being b**y annoying

  • Alphabetical  and Folder Issues

    Ok, let's look at one Event that I have set up and give me some input, correction or answers to the following real scenario if some of you would please.
    I have all the photos of my daughter from the various years of Easter, from 1998 to 2006.
    I have the photos organized within the Libary ,Photos section, within their own folder by holiday and year. So, it looks like this Easter 1998, Easter 1999, Easter 2000, etc. Inside each of these folders I have tagged each group of pics using the Batch Change to Easter - the year - and then automatic numbering...so I end up with something like Easter 1999 - 01 and so on and so forth for each additional year and folder. When the pics from each of these folders was finished...I dragged them all in an album that I entitled Easter within My Albums view on the left pane of iPhoto. My event is just titled Easter in the Event view.
    Now, I have three ways of viewing these Easter photos...within Easter Event, Easter Album and within Library, Photos selected. Now this is all fine and dandy except for a few things.
    Why can I not sort the folders within the Library ,Photos view, alphabetically? I do not see an option to do this. Also, there are no subfolders within Events that I see. So, all of the years merge togther to where I get a giant Event folder within Events thats does not seperate the years, which I would like to have.
    Message was edited by: Freis1968
    Message was edited by: Freis1968
    Message was edited by: Freis1968
    Message was edited by: Freis1968
    Message was edited by: Freis1968
    Message was edited by: Freis1968

    If you're in the Photo's window you can sort the photos by title which is essentially alphanumerical. However, the Events/folders that they are in, if you have Event Titles selected to be displayed, will remain in their chronological order based on the file dates. It's the nature of the beast.
    If you want to sort the Event folders in a different order you'll have to batch change the dates of the files in each event via the Photos->Batch Change.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

Maybe you are looking for

  • NForce MB - Problem connecting to AT&T Broadband using on-board NIC

    I can't seem to stay connected to my AT&T Broadband connection using the NForce's Onboard ethernet connector. Looking at the details from running ipconfig /all, my computer reports a MAC address of 00-00-00-00-00-00 Is this normal? Is there anything

  • Cannot sync due to missing i-photo cache

    message pops when trying to sync - cannot sync due to missing i-phone cache. if it is missing where did it go? also, how do I find it?

  • What's this 'Zoom' feature in Safari?

    I was wondering what exactly do you do with this 'Zoom' feature in Safari 3.1.1. When I hit 'Zoom' the window just resizes. But I don't think anything gets zoomed in. So, what's this feature for? How to get this thing working?

  • Triggering a background job of class 'A' from within the ABAP program

    Dear All, We are implementing SAP ECC 6.0 on IBM System i, i5/OS V5R4,  SAP kernel 7.00, kernel patch level 173. Is there a way to control that when a background job is triggered from within an ABAP program using the : CALL FUNCTION 'JOB_OPEN' statem

  • Aggregating fields in ALV (Urgent)

    Hi friends How can i do aggregate in ALV ? eg:- my report output luks like this:- 10C-NAME1     10     3       4 10C-NAME1      2     4       6 10C-NAME1      8    8        8 Now i want to sumup these records and display as one record. Now..my rep ou