commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp SftpFileObject.java
Date Thu, 26 Aug 2004 16:39:40 GMT
imario      2004/08/26 09:39:40

  Modified:    vfs/src/java/org/apache/commons/vfs/provider/sftp
                        SftpFileObject.java
  Log:
  allow set of lastModTime
  
  Revision  Changes    Path
  1.11      +17 -23    jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java
  
  Index: SftpFileObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp/SftpFileObject.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SftpFileObject.java	4 Jul 2004 18:45:56 -0000	1.10
  +++ SftpFileObject.java	26 Aug 2004 16:39:40 -0000	1.11
  @@ -155,28 +155,22 @@
        *                send times with nanosecond precision but at the moment jsch send
them
        *                with second precision.
        */
  -    /** Wait for jsch release
  -     protected void doSetLastModifiedTime(final long modtime)
  -     throws Exception
  -     {
  -     final ChannelSftp channel = fileSystem.getChannel();
  -     try
  -     {
  -     int newMTime = (int) (modtime / 1000L);
  +    protected void doSetLastModifiedTime(final long modtime)
  +        throws Exception
  +    {
  +        final ChannelSftp channel = fileSystem.getChannel();
  +        try
  +        {
  +            int newMTime = (int) (modtime / 1000L);
   
  -     // this was the only way to make the long to int preserving accuracy
  -     // String str = "" + modtime;
  -     // int newMTime = Integer.parseInt(str.substring(0, str.length() - 3));
  -
  -     attrs.setACMODTIME(attrs.getATime(), newMTime);
  -     channel.setStat(getName().getPath(), attrs);
  -     }
  -     finally
  -     {
  -     fileSystem.putChannel(channel);
  -     }
  -     }
  -     */
  +            attrs.setACMODTIME(attrs.getATime(), newMTime);
  +            channel.setStat(getName().getPath(), attrs);
  +        }
  +        finally
  +        {
  +            fileSystem.putChannel(channel);
  +        }
  +    }
   
       /**
        * Deletes the file.
  
  
  

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


Mime
View raw message