Cyberduck Mountain Duck CLI

Changeset 43141


Ignore:
Timestamp:
Nov 3, 2017 1:01:53 PM (4 years ago)
Author:
dkocher
Message:

Review.

Location:
shelves/Tomas_Celaya
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shelves/Tomas_Celaya

    • Property subgit:lock changed from commit:0bc3ba9a91e99f794798b9077ec348ded5d4a454 timestamp:2017-11-06T08:57:00.634 to commit:3b29dca74afd6cb4d45abd04fe253160ea21194f timestamp:2017-11-06T08:57:02.373
  • shelves/Tomas_Celaya/manta/src/main/java/ch/cyberduck/core/manta/MantaObjectAttributeAdapter.java

    r43135 r43141  
    2727import java.net.URISyntaxException;
    2828
    29 import com.joyent.manta.client.MantaClient;
    3029import com.joyent.manta.client.MantaObject;
    3130
     
    6766    }
    6867
    69     private void populateGenericAttributes(final MantaObject mantaObject, final PathAttributes attributes) {
    70         final String[] pathSegments = mantaObject.getPath().split(MantaClient.SEPARATOR);
    71 
    72         attributes.setDisplayname(pathSegments[pathSegments.length - 1]);
    73         attributes.setOwner(session.getAccountOwner());
    74 
    75         populatePermissionsAttribute(mantaObject, attributes);
    76 
    77         if(mantaObject.getLastModifiedTime() != null) {
    78             attributes.setModificationDate(mantaObject.getLastModifiedTime().getTime());
     68    private void populateGenericAttributes(final MantaObject object, final PathAttributes attributes) {
     69        final Permission.Action userPermissions =
     70            session.isUserWritable(object)
     71                ? Permission.Action.all
     72                : Permission.Action.read;
     73        final Permission.Action otherPermissions =
     74            session.isWorldReadable(object)
     75                ? Permission.Action.read
     76                : Permission.Action.none;
     77        attributes.setPermission(new Permission(userPermissions, Permission.Action.none, otherPermissions));
     78        if(object.getLastModifiedTime() != null) {
     79            attributes.setModificationDate(object.getLastModifiedTime().getTime());
    7980            attributes.setCreationDate(attributes.getModificationDate());
    8081        }
    8182    }
    8283
    83     private void populatePermissionsAttribute(final MantaObject mantaObject, final PathAttributes attributes) {
    84         final Permission.Action userPermissions =
    85                 session.isUserWritable(mantaObject)
    86                         ? Permission.Action.all
    87                         : Permission.Action.read;
    88         final Permission.Action otherPermissions =
    89                 session.isWorldReadable(mantaObject)
    90                         ? Permission.Action.read
    91                         : Permission.Action.none;
    9284
    93         attributes.setPermission(new Permission(userPermissions, Permission.Action.none, otherPermissions));
    94     }
    95 
    96     private void populateLinkAttribute(final PathAttributes attributes, final MantaObject mantaObject) {
     85    private void populateLinkAttribute(final PathAttributes attributes, final MantaObject object) {
    9786        // mantaObject.getPath() starts with /
    98         final String joinedPath = session.getHost().getDefaultWebURL() + mantaObject.getPath();
     87        final String joinedPath = session.getHost().getDefaultWebURL() + object.getPath();
    9988
    10089        try {
Note: See TracChangeset for help on using the changeset viewer.