You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by bperquku <bp...@gmail.com> on 2008/05/21 16:54:43 UTC

apache commons net

 Hi all,

I have a simple java applicatoion, that uploads a file in a computer server
(aix). In the server another process  checks for that file, processes it,
and deletes it.

Is there any possible way to set a lock in file that will be uploaded,
because if the file size is big ex. 200 MB the process on server will delete
my file before my application finished uploading.

Thnx.
-- 
View this message in context: http://www.nabble.com/apache-commons-net-tp17364293p17364293.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: apache commons net

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bperquku,

bperquku wrote:
| I have a simple java applicatoion, that uploads a file in a computer
server
| (aix). In the server another process  checks for that file, processes it,
| and deletes it.
|
| Is there any possible way to set a lock in file that will be uploaded,
| because if the file size is big ex. 200 MB the process on server will
delete
| my file before my application finished uploading.

Are you able to modify either the client or the server? I would include
some kind of file signature so that the server can verify that the file
has been uploaded correctly.

We do this with our daily backups: we include a SHA signature file with
all backup files, and when we copy files, we copy the data first, then
the signature. So, if you see a data file with not signature, you can be
(relatively) sure that the upload has not completed. Once the sig file
appears (and is the correct size), you can run your checksumming
function against the data file to make sure that the transfer has
completed successfully.

After that has been verified, you can proceed with your data processing.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg0OrMACgkQ9CaO5/Lv0PBgQgCgszrOYoZb5D603cuZiSullVzz
u50An0r6GC+l+pWOZk2bvAr4WhkYySeo
=xkSA
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: apache commons net

Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
bperquku skrev  den 21-05-2008 16:54:
>  Hi all,
>
> I have a simple java applicatoion, that uploads a file in a computer server
> (aix). In the server another process  checks for that file, processes it,
> and deletes it.
>   
You can upload it first with another name, and then rename it on the server.

-- 
  Thorbjørn

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: apache commons net

Posted by "F. Andy Seidl" <fa...@myst-technology.com>.
Consider uploading *two* files:  the one you want to process followed by a
1-byte "semaphore" file that is used to signal the server process that
action is needed.

The server process watches for the existence of the semaphore file and, when
seen, processes the primary file and then deletes both files.

If there is the possibility of multiple concurrent uploads, you could refine
strategy along these lines:

* Semaphore files use a .fin extension.

* Each semaphore file has a GUID filename to avoid collisions.

* The content of the semaphore file is the filename of the primary file to
be processed on line one and "END" on line two.

* The server process validates the .fin file by checking for END on line two
and an existing file to process matching the name on line one.

-- fas

F. Andy Seidl
MyST-Technology Partners, Inc.

-----Original Message-----
From: bperquku [mailto:bperquku@gmail.com] 
Sent: Wednesday, May 21, 2008 10:55 AM
To: user@commons.apache.org
Subject: apache commons net


 Hi all,

I have a simple java applicatoion, that uploads a file in a computer server
(aix). In the server another process  checks for that file, processes it,
and deletes it.

Is there any possible way to set a lock in file that will be uploaded,
because if the file size is big ex. 200 MB the process on server will delete
my file before my application finished uploading.

Thnx.
-- 
View this message in context:
http://www.nabble.com/apache-commons-net-tp17364293p17364293.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org