Skip to content

Commit

Permalink
deprecated: Move S3FileSystem#key2Parts into S3Utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-todorov committed Nov 21, 2024
1 parent 03cd6fb commit 9ea4d32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
import java.nio.file.PathMatcher;
import java.nio.file.WatchService;
import java.nio.file.attribute.UserPrincipalLookupService;
import java.util.List;
import java.util.Properties;
import java.util.Set;

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.carlspring.cloud.storage.s3fs.util.S3Utils;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.Bucket;
import static org.carlspring.cloud.storage.s3fs.S3Path.PATH_SEPARATOR;
Expand Down Expand Up @@ -171,9 +174,14 @@ public String getEndpoint()
return endpoint;
}

/**
* @deprecated Use {@link org.carlspring.cloud.storage.s3fs.util.S3Utils#key2Parts(String)} instead. To be removed in one of next majors versions.
* @param keyParts
* @return String[]
*/
public String[] key2Parts(String keyParts)
{
return keyParts.split(PATH_SEPARATOR);
return S3Utils.key2Parts(keyParts);
}

public int getCache()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import software.amazon.awssdk.services.s3.model.Permission;
import software.amazon.awssdk.services.s3.model.S3Exception;
import software.amazon.awssdk.services.s3.model.S3Object;

import static org.carlspring.cloud.storage.s3fs.S3Path.PATH_SEPARATOR;
import static software.amazon.awssdk.http.HttpStatusCode.NOT_FOUND;

/**
Expand Down Expand Up @@ -310,4 +312,10 @@ else if (!resolvedKey.equals(key) && resolvedKey.startsWith(key))
return new S3BasicFileAttributes(resolvedKey, lastModifiedTime, size, directory, regularFile);
}

public static String[] key2Parts(String keyParts)
{
return keyParts.split(PATH_SEPARATOR);
}


}

0 comments on commit 9ea4d32

Please sign in to comment.