You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Nadir Amra <am...@us.ibm.com> on 2008/04/16 18:17:36 UTC

[Axis2} setLastModified() in deployment code problems

I question the usage of the the File class's method setLastModified() in 
WSInfoList.java:



    private void setLastModifiedDate(File file, WSInfo wsInfo) {
        if (file.isDirectory()) {
            File files [] = file.listFiles();
            for (int i = 0; i < files.length; i++) {
                File fileItem = files[i];
                if (fileItem.isDirectory()) {
                    setLastModifiedDate(fileItem, wsInfo);
                } else {
 fileItem.setLastModified(wsInfo.getLastModifiedDate());
                }
            }
        } else {
            file.setLastModified(wsInfo.getLastModifiedDate());
        }
    }


I do not understand why we are actually modifying the last-modified-date 
of the file object?   Can someone please expain this to me? 

The main reason is that this causes problems when the user ID that AXIS2 
is running under does not have authority to update the files.  So the 
attempt to modify the files will not result on anything be done (we 
apparently do not check if operation failed), but more importantly, if 
system auditing is enabled you will see authority-failure auditing records 
for each attempt to modify the timestamp for a file.  And if hotupdate is 
deployed, this will result in 1000's of these records. 

Possible solution:  Why do we need to test for equality when looking at 
time-stamps? We can save the new'est last-modified time stampt, and then 
when we want to detect if something has changed, we simply see if the 
saved-timestamp is greater or equal to the file-timestamp.  And if this is 
true, then the file has not changed.  Otherwise, the file has 
changed.....the added benefit is we do not have to update files. 

I would like to get this in for 1.4 if possible so please respond as soon 
as possible.  If I do not hear from anyone in the next 2-3 days, I will 
open a jira and implement a new solution. 




Nadir Amra
Integrated Web services for i5/OS
IBM Rochester, MN,  (Tel. 507-253-0645, t/l 553-0645)
Internet: amra@us.ibm.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2} setLastModified() in deployment code problems

Posted by Glen Daniels <gl...@thoughtcraft.com>.
+1 - this seems a little weird.  We certainly shouldn't be modifying 
files as a result of our deployment process.

--Glen

Davanum Srinivas wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Nadir,
> 
> Please post a JIRA and patch ASAP!.
> 
> thanks,
> dims
> 
> Nadir Amra wrote:
> | I question the usage of the the File class's method setLastModified() in
> | WSInfoList.java:
> |
> |
> |
> |     private void setLastModifiedDate(File file, WSInfo wsInfo) {
> |         if (file.isDirectory()) {
> |             File files [] = file.listFiles();
> |             for (int i = 0; i < files.length; i++) {
> |                 File fileItem = files[i];
> |                 if (fileItem.isDirectory()) {
> |                     setLastModifiedDate(fileItem, wsInfo);
> |                 } else {
> |  fileItem.setLastModified(wsInfo.getLastModifiedDate());
> |                 }
> |             }
> |         } else {
> |             file.setLastModified(wsInfo.getLastModifiedDate());
> |         }
> |     }
> |
> |
> | I do not understand why we are actually modifying the last-modified-date
> | of the file object?   Can someone please expain this to me?
> |
> | The main reason is that this causes problems when the user ID that AXIS2
> | is running under does not have authority to update the files.  So the
> | attempt to modify the files will not result on anything be done (we
> | apparently do not check if operation failed), but more importantly, if
> | system auditing is enabled you will see authority-failure auditing 
> records
> | for each attempt to modify the timestamp for a file.  And if hotupdate is
> | deployed, this will result in 1000's of these records.
> |
> | Possible solution:  Why do we need to test for equality when looking at
> | time-stamps? We can save the new'est last-modified time stampt, and then
> | when we want to detect if something has changed, we simply see if the
> | saved-timestamp is greater or equal to the file-timestamp.  And if 
> this is
> | true, then the file has not changed.  Otherwise, the file has
> | changed.....the added benefit is we do not have to update files.
> |
> | I would like to get this in for 1.4 if possible so please respond as soon
> | as possible.  If I do not hear from anyone in the next 2-3 days, I will
> | open a jira and implement a new solution.
> |
> |
> |
> |
> | Nadir Amra
> | Integrated Web services for i5/OS
> | IBM Rochester, MN,  (Tel. 507-253-0645, t/l 553-0645)
> | Internet: amra@us.ibm.com
> |
> | ---------------------------------------------------------------------
> | To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> | For additional commands, e-mail: axis-dev-help@ws.apache.org
> |
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Cygwin)
> 
> iD8DBQFIBippgNg6eWEDv1kRAg0XAKCutB7TMAcPDnc9YzUeo6/aY6/HQACgqy+1
> hNkNfOSgLdXhx4bOh30+6/E=
> =NblX
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2} setLastModified() in deployment code problems

Posted by Davanum Srinivas <da...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nadir,

Please post a JIRA and patch ASAP!.

thanks,
dims

Nadir Amra wrote:
| I question the usage of the the File class's method setLastModified() in
| WSInfoList.java:
|
|
|
|     private void setLastModifiedDate(File file, WSInfo wsInfo) {
|         if (file.isDirectory()) {
|             File files [] = file.listFiles();
|             for (int i = 0; i < files.length; i++) {
|                 File fileItem = files[i];
|                 if (fileItem.isDirectory()) {
|                     setLastModifiedDate(fileItem, wsInfo);
|                 } else {
|  fileItem.setLastModified(wsInfo.getLastModifiedDate());
|                 }
|             }
|         } else {
|             file.setLastModified(wsInfo.getLastModifiedDate());
|         }
|     }
|
|
| I do not understand why we are actually modifying the last-modified-date
| of the file object?   Can someone please expain this to me?
|
| The main reason is that this causes problems when the user ID that AXIS2
| is running under does not have authority to update the files.  So the
| attempt to modify the files will not result on anything be done (we
| apparently do not check if operation failed), but more importantly, if
| system auditing is enabled you will see authority-failure auditing records
| for each attempt to modify the timestamp for a file.  And if hotupdate is
| deployed, this will result in 1000's of these records.
|
| Possible solution:  Why do we need to test for equality when looking at
| time-stamps? We can save the new'est last-modified time stampt, and then
| when we want to detect if something has changed, we simply see if the
| saved-timestamp is greater or equal to the file-timestamp.  And if this is
| true, then the file has not changed.  Otherwise, the file has
| changed.....the added benefit is we do not have to update files.
|
| I would like to get this in for 1.4 if possible so please respond as soon
| as possible.  If I do not hear from anyone in the next 2-3 days, I will
| open a jira and implement a new solution.
|
|
|
|
| Nadir Amra
| Integrated Web services for i5/OS
| IBM Rochester, MN,  (Tel. 507-253-0645, t/l 553-0645)
| Internet: amra@us.ibm.com
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
| For additional commands, e-mail: axis-dev-help@ws.apache.org
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFIBippgNg6eWEDv1kRAg0XAKCutB7TMAcPDnc9YzUeo6/aY6/HQACgqy+1
hNkNfOSgLdXhx4bOh30+6/E=
=NblX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org