You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2006/03/23 11:02:09 UTC
DO NOT REPLY [Bug 39076] New: - Offset and resume not working...
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39076>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=39076
Summary: Offset and resume not working...
Product: Commons
Version: 1.4 Final
Platform: All
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: File Upload
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: marc.aymar@nice.fi
CC: commons-dev@jakarta.apache.org
When setting the restart offset : setRestartOffset(long offset) one would
expect that when resuming storing the same file on the server, it will restart
from that offset and not from beggining.
I made the follwoing change (-->><<--) in the org.apache.commons.net.io.Util
class
public static final long copyStream(long offset, source,...
...
try {
-->> source.skip(offset); <<--
while ((bytes = source.read(buffer)) != -1) {
...
This change allows to skip the bytes until the offset mark.
In the main code there is of course a need to set :
ftpClient.setRestartOffset(dest_file_size);
output = ftp.storeFileStream("filename");
dest_file_size was calculated using the following code as I haven't found a
method return the size of the file:
static long getSize(FTPFile[] ftpFiles, String filename){
for(int i=0; i<ftpFiles.length;i++){
if (ftpFiles[i].getName().equalsIgnoreCase(filename)){
return ftpFiles[i].getSize();
}
}
return -1;
}
where ftpFiles = ftpClient.initiateListParsing().getFiles();
What do you think??
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 39076] - [fileupload] Offset and resume not working...
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39076>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=39076
niallp@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Offset and resume not |[fileupload] Offset and
|working... |resume not working...
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
DO NOT REPLY [Bug 39076] - [net] Offset and resume not working...
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39076>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=39076
martinc@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|File Upload |Net
Summary|[fileupload] Offset and |[net] Offset and resume not
|resume not working... |working...
------- Additional Comments From martinc@apache.org 2006-03-23 16:20 -------
This looks like a Commons Net issue. It's definitely not Commons FileUpload.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org