code: public long length() throws SmbException {
          if( sizeExpiration > System.currentTimeMillis() ) {
              return size;
          }
  
          if( getType() == TYPE_SHARE ) {
              Trans2QueryFSInformationResponse response;
              int level = Trans2QueryFSInformationResponse.SMB_INFO_ALLOCATION;
  
              response = new Trans2QueryFSInformationResponse( level );
              send( new Trans2QueryFSInformation( level ), response );
  
              size = response.info.getCapacity();
          } else if( getUncPath0().length() > 1 && type != TYPE_NAMED_PIPE ) {
              Info info = queryPath( getUncPath0(),
                      Trans2QueryPathInformationResponse.SMB_QUERY_FILE_STANDARD_INFO );
              size = info.getSize();
          } else {
              size = 0L;
          }
          sizeExpiration = System.currentTimeMillis() + attrExpirationPeriod;
          return size;
      }
docs: Returns the length of this <tt>SmbFile</tt> in bytes. If this object
  is a <tt>TYPE_SHARE</tt> the total capacity of the disk shared in
  bytes is returned. If this object is a directory or a type other than
  <tt>TYPE_SHARE</tt>, 0L is returned.
  
  @return The length of the file in bytes or 0 if this
  <code>SmbFile</code> is not a file.
  @throws SmbException