yasithdev opened a new pull request, #652:
URL: https://github.com/apache/airavata/pull/652

   ## Summary
   
   The gRPC `UserStorageService` file-listing metadata (`list_dir` / 
`get_file_metadata`) only carried `name`/`path`/`size`/`is_directory`, so 
clients lose the **modified time** and **content type** a file browser needs to 
display. The proto `FileMetadataResponse` already declares `modified_time` and 
`content_type`; this populates them server-side.
   
   - `FileMetadata` gains `modifiedTime` (epoch millis) and `contentType`.
   - `SSHJStorageAdaptor.getFileMetadata` sets `modifiedTime` from the SFTP 
`stat` mtime (seconds → millis) and guesses `contentType` from the file name 
(`URLConnection.guessContentTypeFromName`).
   - `UserStorageGrpcService.toFileMetadataResponse` copies both into the 
response.
   
   `created_time` is not available over SFTP, so it remains unset.
   
   This is part of unblocking the Django portal's storage-listing migration off 
the legacy Thrift SDK (the file browser renders per-file modified time + MIME 
type).
   
   ## Validation
   
   - Live against the running server: an uploaded file's `get_file_metadata` 
and `list_dir` now return `modified_time` (the upload time, e.g. epoch millis 
decoding to the upload instant) and `content_type` (`text/plain` for a `.txt`).
   - `mvn test -pl airavata-api/storage-service,airavata-api/compute-service` → 
35 pass, 0 failures.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to