File Copy with resume enable

I am thinking of making a file copy program like the download managers, which provides resume enables, so that users can continue at later times.
Suppose, i have a 10 GB file, and i want to transfer it over to my external, then instead of non breakable file copying, user get the option to stop, and resume laters from that point only.
I am not sure if its feasible in java, but if its, please tell me how to achieve that.
I am not asking you to give me the code, rather a bit about how to proceed in that direction.
Thank you.

user7761515 wrote:
I am thinking of making a file copy program like the download managers, which provides resume enables, so that users can continue at later times.Well, I suspect you're going to have to come up with some sort of protocol that allows your copy job to complete its task (eg, a separate file containing the number of bytes written to the "partial" so that it knows where to resume from). I'd also suggest that you use some sort of name extension to distinguish your partial from a completed file, and only rename it when you know the job is finished.
Alternatively, you could create "chunks" for each portion copied between a start/resume and the next pause (maybe with numbered extensions) and then concatenate them together as a final step (possibly simpler, but likely less efficient in space and time).
Another thing to think about is changes: What if someone changes the file you want to copy between the time you pause and the time you resume? I suspect it should invalidate the whole job, but you'll probably want to check modification times (or alternatively, use a checksum) before you resume.
If this is just an exercise, great; otherwise I suspect you may be re-inventing the wheel.
Winston
Edited by: YoungWinston on Nov 13, 2010 12:02 PM
It also occurs to me that you might want to investigate FTP. I'm pretty sure it has hooks for pausing and resuming, but you'll probably have to check if the Java library you choose allows that capability.

Similar Messages

  • File copy with change of file type

    I'm currently working on what seems like a simple file-to-file scenario. A file (without an extension) on server A has to be copied to server B. The name of the file on the target server should be the same as the file on the source system. Only change is that the file on the target system should get a .txt extension. After trying various options I'm stuck on the .txt extension.
    I enabled File Name in Adapter Specific Message Properties on both the sender and receiver communication channels. With this option the file gets copied to the target server with the same name, but I cannot add the .txt extension. I also followed the instructions in this blog: https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken] Unfortunately, I don't see the file name in the payload of my message, which means I cannot use it in the Variable Substitution option of my receiver communication channel.
    Does anyone know what I might be doing wrong here?
    Edited by: Cheese2 on Jul 15, 2009 12:39 PM

    use dynamic configuration. you can manipulate the file names very easily - /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - in your case as per this blog all you need to change in the code will be;
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    ourSourceFileName = ourSourceFileName + ".txt";
    return  ourSourceFileName;

  • File copy with 2 IDE Drive and Soundblaster problem

    Hi,
    When i try to copy large files my system will usually lock (windows totally freezes, the only solution is to do a hard reset). I cut the problem down to beeing an issue with my sound blaster live platinum 5.1.
    Everything is working fine when I remove the soundblaster.
    I read somewhere that this problem was known with former motherboard with VIA chipset like KT133 but I was hoping it had been fixed since then...
    Here's my config :
    KT6 Delta 2 FISR
    Athlon Barton 2500+
    512 Mo  RAM
    2 IDE Drive (not on the same IDE connector)
    Creative Live Sound Blaster Platinum 5.1 (CT4830)
    I have upgraded all the possible drivers : VIA4in1 (v4.51), latest BIOS upgrade (E6590v2.0), latest creative drivers....
    I tried a lot of different settings in the BIOS (PCI latency, PCI bus mastering etc...)
    This is really anoying...
    Please help !!!

    change pci latency to 96.
    change "system performance setting" within DRAM settings to "FAST"
    you could also;
    try changing "System Bios Cachable" to "Enabled"
    and change "C000 Shadow" to "Cacheable"
    im using all those above settings, and thats with ALOT of drives attached as well, and ive been copying 20+GB files all over the place including over network drives.

  • Unable to access UNC path on 2012 R2 file server with ABE enabled

    Brief Description:
    We have granted access to people via a domain local group on a folder on a file server that is three levels deep from the share, i.e. \\servercluster\share\folder1\folder2\folder3, where folder3 is where the group is granted Read & Execute
    access.  The share has Access-Based Enumeration (ABE) enabled and the Everyone group has Full Control share permissions.  We also use DFS, so the path for that is \\domain\dfsrootname\folderfororganization\share\folder1\folder2\folder3.  People
    in the aforementioned group only have access to folder3, its subfolders, and files.  They do not have any access to folder2 or any of the other folders higher in the tree at all.  Also, consider that folder3 contains a subfolder folder4, which is
    simply inheriting permissions. 
    What we have found is that clients running Windows 7 SP1 have strange access issues when attempting to access the folder via either the DFS or cluster name UNC paths.
    Detailed Testing Results Accessing Folder3 Directly:
    NOTE:  "UNC path" in the following test results means either the DFS or the cluster name share path.  The results are the same regardless which path is used.
    1 - Enter UNC path without trailing backslash in Windows Explorer's address bar:
    Windows Explorer seems to do nothing for about 30 seconds and then displays the following error:
    "Windows cannot access <UNC path>
    Check the spelling of the name.  Otherwise, there might be a problem with your network.  To try to identify and resolve network problems, click Diagnose."
    2 - Enter UNC path with trailing backslash in Windows Explorer's address bar:
    The same error encountered in #1 is displayed immediately.
    3 - Enter UNC path with or without trailing backslash but contained in double quotes in Windows Explorer's address bar:
    Internet Explorer opens and displays the error:
    "Internet Explorer cannot display the webpage"
    4 - Enter UNC path without trailing backslash in Run dialog box:
    An error message immediately appears:
    "<UNC path>
    The specified path does not exist.
    Check the path and then try again."
    5 - Enter UNC path with trailing backslash in Run dialog box:
    Same as #4.
    6 - Enter UNC path without trailing backslash but contained in double quotes in Run dialog box:
    Same as #4.
    7 - Enter UNC path with trailing backslash and contained in double quotes in Run dialog box:
    Windows Explorer opens the correct UNC path location and displays the folder contents.  This is the expected behavior for all of these attempts.
    8 - Create Shortcut to UNC path by performing #7 and then dragging the folder icon in Windows Explorer's address bar to either to the desktop or the Favorites section, and then attempt to access the folder via
    the shortcut.
    Same as #7.
    9 - Attempt to create a shortcut to the UNC path using the New Shortcut wizard:
    Unable to successfully create the shortcut, regardless if you add a backslash at the end or enclose the path in double qutoes.  When you press Next after entering the UNC path, you receive the following error:
    "The file <UNC path> cannot be found."
    10 - Disable ABE on the share and repeat all tests:
    All tests with ABE disabled on the share have the same result as #7.  There is no issue whatsoever accessing the desired folder when ABE is disabled.
    Other Notable Behaviors:
    If the aforementioned folder (folder3) contains one or more subfolders (e.g. folder4), you are able to access those subfolders via UNC path directly and then go up one level to folder3 without issue, even when ABE is enabled.  You just cannot access
    folder3 directly via UNC path unless you attempt to access it via the method used in #7 above or a successfully created shortcut.
    Adding a user account directly to the folder3 ACL rather than using group membership makes no difference.
    If access is granted to folder4 instead of folder3 (the fourth folder deep rather than the third), accessing folder4 directly via UNC path is not an issue regardless of ABE status or attempted access method.
    Windows 8 and 8.1 clients have no trouble directly accessing the folder's UNC path via any method.  The unusual, undesirable behavior seen in Windows 7 is non-existent on Windows 8.x clients.
    Systems Involved:
    Client:  Windows 7 Enterprise SP1 x86
    Server:  Windows Server 2012 R2 Standard in cluster
    Other Details About the Systems:
    Both the client and the file server cluster are in the domain AD DS domain.
    The client and the file server cluster are in different subnets.
    There is no firewall or other packet inspection or compression service/device in between the client and server (not even Windows Firewall).
    Question:
    Is there a way to fix this behavior with Windows 7 clients and ABE enabled on the share so that it works correctly without forcing the clients or server to use SMBv1 or disabling ABE on the shares?

    7-Zip 9.20
    Adobe Flash Player 13 ActiveX
    Cisco WebEx Meetings
    Java 7 Update 51
    It should be noted that I can't repeat the behavior on my test machine again today after some changes were made in our environment.
    Today, I found that someone had modified permissions on the folder to give the group my test account was a member of rights to traverse the folder hierarchy from the root of the share.  Additionally, in testing something with FIPS mode, I ended up reverting
    my virtual machine to an older snapshot.
    After removing the extra permissions that weren't present when I was doing my testing and reverting to the older snapshot, I  am not having issues accessing the real equivalent of folder3 directly in Windows Explorer via DFS UNC path or creating a shortcut
    with the New Shortcut wizard.
    Things have been fundamentally changed and I cannot repeat the behavior on this particular folder.  I will see if I can recreate the same situation on another folder.

  • Creating a control file copy with ASM

    Configuration is Oracle 10.2, RAC, and ASM (Automatic Storage Management). I would like to create a second copy of the control file.
    If this wasn't ASM, I could just bring down the database, copy the control file using an operating system command, modify the pfile to reference both the original and new copy, and then restart the database.
    Since this is ASM, I cannot use an operating system command to copy the control file, and RMAN "BACKUP" (which is the only way I know to make a copy of the control file) will only work if the database is up. When I "restore" the control file using RMAN and change the pfile to reference both control files I get a message like the following when attempting to start the database:
    ORA-00214: control file '+ASMGROUP1/db1/controlfile/current.271.566646845'
    version 2241 inconsistent with file
    '+ASMGROUP1/db1/controlfile/current.268.566661765' version 2236
    Soooooo, how do I make and implement a second copy of a control file using ASM.
    Thanks

    Hi.
    This is not testet so presede with caution as it is meant as a discussion ;-)
    As I see it there is no logical way to extend the instance by adding a controlfile.
    The following procedure might work (has not been tested)
    I think you have to make a controlfilebackup with the database closed in normal mode using RMAN.
    Further you might be able to edit the pfile with create pfile from spfile and further create spfile from pfile. Extending the controlfile parameter to represent number and names of controlfile needed.
    With this done, the database is closed normal with a controlfile copy presented somewhere on the filesystem.
    startup mount;
    restore controlfile from '<backup controlfile location>'
    alter database mount;
    alter database open;
    Any thoughts about this procedure guys?
    Rgds
    Kjell Ove

  • File Copy With JProgressBar

    Hi i'm using the below code to copy a file and display the progress on screen. However the file copies ok by the progressbar is never shown. Can somebody please show me how to use the JProgressBar Component to copy a file and show the progress?
    Thanks
    Arlef
    public void copyFileToMediaFolder(File f){
    String newFileName = f.getName();
    try{
    File inputFile = f.getAbsoluteFile();
    int fSize = (int)f.length();
    FileCopyProgress fcp = new FileCopyProgress(this,true);
    File outputFile = new File(mediaFolder + File.separatorChar + newFileName);
    FileInputStream in = new FileInputStream(inputFile);
    FileOutputStream out = new FileOutputStream(outputFile);
    int c;
    int bytesRead = 0;
    int counter = 0;
    while ((c = in.read()) != -1){
    out.write(c);
    counter = counter + 1;
    bytesRead = fSize / 100 * counter;
    in.close();
    out.close();
    fcp.dispose();
    }catch(Exception ex){
    //System.out.println("nEW FILE NAME = "+newFileName);
    }

    The progressbar is in a JDialog and is represented in
    the following line in the code i sent earlier
    FileCopyProgress fcp = new FileCopyProgress(this,true);Yes, i'm aware of that, but what I'm saying is that you don't seem to be updating the status of the progressbar while copying the file...I suppose the progressbar would start with 0 or 0% and then there should be some functions to be called to make it "progress" to 10..20...50..60% etc... So I believe you should call such a function from inside the loop where the file is being copied...I remember it used to be like that in Visual C++, so i'm supposing the behavior is similar in Java.
    Good luck :)
    Talal

  • XMP files remain with NEF files in my folder.  Camera Raw suddenly reset leaving my edits gone.  Will XMP files enable me to resume with those lost edits?

    XMP files remain with NEF files in my folder.  Camera Raw suddenly reset leaving my edits gone.  Will XMP files enable me to resume with those lost edits?

    I never tried this, but I'm pretty sure that with DNG files, Lightroom will ignore xmp files, even when you instruct Lightroom to "Read Metadata from File". Lightroom expects all the metadata to be in the DNG file, not in the xmp file.
    Pick flags, as far as I know, are never written to xmp file; nor are they written to DNG files.
    If you're going to make this transfer procedure work, you need to do it by either (a) embedding the metadata in the DNG file and send those back and forth; or (b) use RAW and xmp and then sending the xmp files back and forth (plus I guess you have to transfer the original RAW once to your editor)

  • Looking for a file manager with copy queue

    Hey,
    I'm looking for a file manager with a file-copy-queue feature.
    It is useful when browsing mounted samba shares, and you find something you want to copy.
    You'll then start copying the files, and then spot another useful folder. You start copying that as well
    and suddenly you got 5 different file copies processing at the same time, which decreases the copy speed.
    I also miss the feature when transfering files from my external harddrives.
    If there is a lot of FM's with this feature, I prefer one without kde-dependencies, as I am using xfce.

    Ranguvar wrote:If MC really does have that as a feature, it's once again proved itself _the_ graphical (sorta) file manager.
    sorry for misinformed.
    mc has a background job option while copying, it is not exactly a queue like functionality, but simulating to be a queue, and you can stop/resume a background job.

  • Problem with File.copy() -- should this work?

    I'm trying to copy a number of script files (I'm testing with just one) out of one folder into another. Here's the code:
    (function() {
      var myFolder = Folder(getScriptPath().parent + "/disabled");
      if (myFolder.exists) {
        var myScripts = myFolder.getFiles("*.jsx");
          for (var j = 0; myScripts.length > j; j++) {
          if (myScripts[j].copy("../enabled")) {
            myScripts[j].remove();
      function getScriptPath() {
        // This function returns the path to the active script, even when running ESTK
        try {
          return app.activeScript;
        } catch(e) {
          return File(e.fileName);
      } // end getScriptPath
    What's happening is that the file in the disabled folder is simply being deleted. This means that the copy method is returning true and yet the copy didn't happen. Perhaps my URI is wrong, but if so, the copy should have failed. The file is not in either the InDesign or ESTK packages, which seem to be the only two worth looking in -- I was running from ESTK with InDesign CS4 targeted.
    Dave

    You can set the current folder like this:
    Folder.current = "/d/test1/test2"
    Then change to that current folder's parent using
    Folder.current = ".."
    But you can't use .. in file masks. This won't work:
    var myFiles = Folder.cuttent.getFiles ("../*.jsx")
    The only way of using .. (as far as I can see) is with literal filenames:
    myFile = '../nonsense.txt'
    which points to nonsense.txt in current folder's parent folder. But this is unclear as you dont't have a reference to the current folder in your statement. I agree that using relative file paths is vague and it looks as if they're best avoided.
    Why copy() returns true when in fact it hasn't worked looks like a bug. I've tried it a couple of times and on Windows it gives the same results as with you: copy() says true when nothing's happened.
    Peter

  • HT204387 can we get apple to make a fix to download that would enable the bluetooth file sharing with any deivce?

    can we get apple to make a fix to download that would enable the bluetooth file sharing with any deivce? i would like to to stay with Apple iphone but if they dont improve the lack of features.. i will move on and I know im not the only person to think like this.
    regards
    gavin_p

    There is not "fix" to be provided, Apple made a decision to not include the file sharing profile.
    You are welcome to provide feedback, but after six years, I would not hold your breath.
    Feedback can be left here: http://www.apple.com/feedback/iphone.html

  • JPEG/PSD issue--I open a jpeg and edit it (levels, crop) and then "save as" and the save as option shows there are now levels in the image and it wants to save it as a .psd file or a copy with layers.  What am I doing that has these settings appear?

    JPEG/PSD issue--I open a jpeg and edit it (levels, crop) and then "save as" and the save as option shows there are now levels in the image and it wants to save it as a .psd file or a copy with layers.  What am I doing that has these settings appear?

    16bit? Pixels extending beyond the canvas? (from a crop with delete unused pixels turn off).  Have you previously been saving PSD files?
    IME you sometimes have to tell Photoshop that the first save of a session is JPG, and it remembers from there on.  The way to 'tell' Photoshop that JPG, or PDF, or PNG etc are now your preferred format is to Ctrl (Cmd) click on that format in the Save As drop down list.  So long as the file does not have parameters that your chosen format does not support, then this should work for you.
    [EDIT]  Just noticed that you did include 'Crop' in the subject line.  Do you have 'Delete cropped pixels' checked?

  • Itunes is copying/converting 500gb of music from .wma to .m4a files that are on an external drive onto my laptop which doesnt have enough room. how do i reroute these newly converted files somewhere with enough space for them?

    itunes is copying/converting 500gb of music from .wma to .m4a files that are on an external drive onto my laptop which doesnt have enough room. how do i reroute these newly converted files somewhere with enough space for them?
    new to itunes, used windows media player before that and always ripped music directly to an external hardrive and accessed it through the player. now that i downloaded itunes it is taking from the external hardrive and copying a second file for each song onto my lap top hard drive which does not have the capacity for all my music. as itunes converts music files i want them saved back onto my external drive or another location i have space for rather than the lap top. how do i change the setting to move the itunes media folder to another location. assuming that hitting copy and past and dropping it in a random location will cause a few errors.

    When I have done this, all I did was network the two machines and copy the contents of the iTunes folder to the other machine, and that's it.
    My understanding (which may not be 100% correct) is that the one file that is absolutely necessary is iTunes Library, and that the XML file is actually a copy auto-generated from the iTunes Library, appearing in a different format only for non-iTunes apps that take advantage of the iTunes Library data.
    As far as I know, if you simply have the Library (database) file and all your original music files, iTunes on that computer should operate as it did on your old computer. I believe that the Album Artwork, Genius Data, and XML files can be regenerated from the Library file. Not sure about the Extras file.

  • I am batch processing in PS 2014 (watermark and saving as jpeg from ps file). I get the message for some but not all 'this file needs to be saved as a copy with this option'. And then I have to save it manually. Does anyone know why this happens? (It is j

    I am batch processing in PS 2014 (watermark and saving as jpeg from ps file). I get the message for some but not all 'this file needs to be saved as a copy with this option'. And then I have to save it manually. Does anyone know why this happens? (It is just a plain photoshop file, a watermark is added, then save as jpeg - the jpeg is saved to a different folder than the original photoshop file.)  It happens for about 10 of 30/40  files approximately . Thank you, Kathryn

    I believe I have figured it out - I need to flatten the image, even though there are no layers except for layer 0, first.

  • Problem with UTL FILE COPY

    Hi,
    I am facing one small problem in UTL FILE COPY package. We have an automated scheduled batch process. As a daily batch process it moves the files from one folder to other. During movement, it first copies the file from source folder to destination folder using FILE COPY package and then removes the file using FILE REMOVE package from the source folder.
    Few cases are found that the file when files are copied they are copied as 0 bytes in destination folder but the source file had 1 MB file size. The interesting part is I am unable to replicate the issue. Means when i try to run once again the package its working properly and files are copied with correct size. This kind is issue is occuring very rarely though as once in month but the question is why FILE_COPY package is not working properly sometimes.. I am unable to understand.
    Thanks a lot for going through this. Any suggestions.
    Regards,
    Ashish

    Anyhow make sure that the copy will start after the full generation of files.
    You can think like a spool file generation with huge data. In that case initially spool file available with 0 byte only. After finish of query only it shows its actual size.

  • Importan Topic. Bigger File Dowload/Upload with resume feature

    Hi All
    How do I download/upload bigger files(like 10 GB) using servlet. For example if I try upload 10 GB file and if I got disconnected around 1GB, I would like to know how do I resume the upload from where I got disconnected. Is anybody got sample code for upload/dowload with Resume feature.
    Thanks
    Dhamo

    Where do you want to upload it to?
    A ftp server?
    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html

Maybe you are looking for

  • ITunes 6/Quicktime 7.3

    It won't let me use iTunes 6, because for some reason it installed Quicktime version 7.2, and it needs 7.3, but... why didn't it install it in the first place? Does this version even exist? HELP!

  • HL Physical Inventory: Control data for storage type  is missing

    Dear experts, When performing an ad-hoc HL inventory in EWM, I'm facing following issue after I try to save the countet inventory document: This is how my storage type where the inventory will be performed looks like: What could be a reason for such

  • SDK in DB2

    Hi Everyone, I have developed some add-on in SAP 2007 and back end is SQL server and it is working fine at the customer side with out any issues. Now the customer is decided to go with DB2 Database, My question is whether the cusomizations will work

  • [solved] Dual view and xfce compositor

    I have some troubles when I'm connecting a monitor to my laptop. In normal times everything works fine. However when the monitor is connected I get this result: http://ompldr.org/vOTU5OQ On the left hand side screen Ario is the active window, however

  • IDCS2 Observing Change of Focus in a page item

    I have a plugin a little like BasicPersistence but with a much more involved UI. At the moment I am updating the persistent data in the same way as BP (i.e. Menu option on the Panel) but this is quite cumbersome for the user and they regularly forget