Commit Graph

709 Commits

Author SHA1 Message Date
Andrew Gaul 04c2394a10 Annotate @BeforeSuite with groups as @AfterSuite
Previously this caused unexpected failures in the B2 integration
tests.
2016-06-16 12:57:38 -07:00
Andrew Gaul 52de3b5766 JCLOUDS-1125: Upload two parts in list MPU test
This allows B2 to call complete multipart upload.
2016-06-13 17:00:50 -07:00
Andrew Gaul 0bd2959410 JCLOUDS-1125: portable list multipart uploads
Only Azure, B2, and S3 support this operation.  Some MultipartUpload
fields become nullable.
2016-06-13 16:26:43 -07:00
Andrew Gaul ed7ff648e8 Ensure MPU input size meets minimum for test 2016-06-02 11:27:21 -07:00
Andrew Gaul d983d8d0a7 Revert "Handle when total length is less than part length"
This reverts commit bc1f12b7bd.
2016-06-02 07:21:48 -07:00
Andrew Gaul bc1f12b7bd Handle when total length is less than part length 2016-06-01 22:01:38 -07:00
Andrew Gaul 63bfc2f6e8 Use prefix option in prefix test
Directory is deprecated.
2016-06-01 17:44:43 -07:00
Andrew Gaul 421764dfd1 Remove disposition checks from testFileGetParallel
Some providers like B2 do not support Content-Disposition and other
tests exercise this functionality.
2016-06-01 16:15:47 -07:00
Andrew Gaul 5a85f5b5f9 Use provided minimum part size in MPU tests 2016-06-01 16:15:15 -07:00
Andrew Gaul 1ac73d3093 Ensure MPU has a minimum size 2016-06-01 16:14:58 -07:00
Andrew Gaul 209152e30a Abort multipart upload on putMultipartBlob error
This avoids dangling incomplete MPU.
2016-06-01 13:34:53 -07:00
Andrew Gaul bf7d864c41 Allow null ETag in MultipartPart
Some storage backends, notably filesystem provider using either
Mac OS X or NFS, do not support extended attributes and cannot store
the ETag.  References andrewgaul/s3proxy#135.
2016-06-01 12:47:02 -07:00
Andrew Gaul fb186d82de Consistently compare quoted ETags in CopyBlob 2016-05-28 12:17:28 -07:00
Andrew Gaul 00a36c3e45 JCLOUDS-654: Add size to BlobMetadata constructor
Follow on to fae097e144.
2016-05-27 17:27:06 -07:00
Andrew Gaul cd50ad905d Avoid NPE in BaseBlobStore.copyBlob
Resolves copyBlob failures in Atmos.
2016-05-12 12:48:07 -07:00
Andrew Gaul 62410d31ae Handle missing containers in LocalBlobStore.list
Also fix FilesystemStorageStrategyImpl.getContainerMetadata to return
null on missing container as jdbc and transient already do.
2016-05-06 21:36:28 -07:00
Andrew Gaul a4c40e15cd Handle unimplemented signed URL tests in providers
This commit makes it evident in source code which providers do not
support this feature.
2016-05-06 10:31:37 -07:00
Andrew Gaul 35f4f2bbf1 Use more unique names in containerDoesntExist
Previously this failed on AWS due to another container named
"forgetaboutit".
2016-03-27 13:48:42 -07:00
Andrew Gaul 2638ba4e69 Consistently quote ETags during comparison
Regression from e0a7ea7fdf.
2016-02-16 23:10:16 -08:00
Andrew Gaul 66609e6d70 JCLOUDS-651: Local blobstore support for conditional copies 2016-02-16 16:29:54 -08:00
Andrew Gaul 8945258d79 JCLOUDS-651: Portable support for conditional copies 2016-02-16 16:29:54 -08:00
Andrew Gaul 293d3f864e Convert CopyOptions into an AutoValue
This commit requires an interface change since AutoValue lacks support
for Optional and uses Nullable annotations instead.
2016-02-16 16:29:54 -08:00
Andrew Gaul a697396e8c Correctly remove prefix in DelimiterFilter
Previously this called String.replaceFirst which uses a regular
expression and incorrectly handles characters like *.  Also remove
other correct but unnecessary call to String.replaceFirst.
2016-02-09 10:48:01 -08:00
Andrew Gaul de333e8b3c Check Content-Length in local blobstore putBlob 2016-02-03 22:03:48 -08:00
quod3 77eef902b4 Use parseLong instead of parseInt in range parser
Use parseLong instead of parseInt when parsing open-ended byte ranges in LocalBlobStore. Without this fix, any "from byte x" or "to byte x" getBlob() call will throw a NumberFormatException if x is too big to fit into an int (2 GB).

Fixes https://issues.apache.org/jira/browse/JCLOUDS-1073
2016-01-30 20:11:07 -05:00
Andrew Gaul eb6f16e2f9 Enable CollectionIncompatibleType
Also suppress two false positives.
2016-01-29 08:50:09 -08:00
Andrew Gaul b6920ca44b JCLOUDS-1065: Deprecate inDirectory option
Superseded by prefix and delimiter support.
2016-01-28 22:59:12 -08:00
Andrew Gaul a3376d4efe Consistently implement domain object methods
Including equals, hashCode, and toString.
2016-01-24 21:58:39 -08:00
Andrew Gaul b50c518f7e Avoid sleeping in signed URL tests
Also bump expiration to a consistent 60 seconds.
2016-01-23 13:48:43 -08:00
Andrew Gaul b2c0786fc0 Enable range tests for azureblob 2016-01-23 12:38:50 -08:00
Andrew Gaul 52dc1a3ccf Add BaseBlobIntegrationTest.testSetBlobAccess
Similar to BaseContainerIntegrationTest.testSetContainerAccess.
2016-01-19 14:40:55 -08:00
Andrew Gaul 688890819e Fix replacing metadata in BaseBlobStore
Fixes Atmos errors.  Uncovered by removing unneeded addContentMetadata
call in BaseBlobIntegrationTest.testCopyBlobReplaceMetadata.
2016-01-15 13:22:15 -08:00
Andrew Gaul 5fd7b1aa78 JCLOUDS-948: Portable Cache-Control support 2016-01-15 04:41:01 -08:00
Andrew Gaul a90245afe5 Add marker and prefix to equals and toString 2016-01-11 19:18:14 -08:00
Andrew Gaul c0d72b6f53 JCLOUDS-844: Local blobstore putBlob ACLs 2015-12-22 00:46:33 -08:00
Andrew Gaul 86491bc607 JCLOUDS-844: Portable putBlob ACLs 2015-12-22 00:46:33 -08:00
Andrew Gaul 37f307ecd0 Skip testSetContainerAccess for local blobstores
These lack a public HTTP endpoint needed for this test.
2015-12-20 01:14:33 -08:00
Andrew Gaul 13701bf7ab Do not test marker contents
Some providers like Azure have opaque markers.
2015-12-19 15:24:12 -08:00
Andrew Gaul a7c66d5120 JCLOUDS-1042: Test reading from public container
Blob has default access but container is public-read.
2015-12-18 23:28:39 -08:00
Andrew Gaul 4abd5dd16f Revert "Delete parts when removing Swift multipart objects"
This reverts commit 3c1588527d.
2015-12-08 10:08:22 +08:00
Andrew Gaul 2dd231b02b Filter out folders when listing a container
These folders represent directories in the filesystem blobstore which
real blobstores do not have.  Their presence complicates providing the
correct marker for paginated listing.  Future commits will remove
folders entirely.
2015-11-20 16:27:53 -08:00
Andrew Gaul 4ce357ba69 Consistently quote ETags in comparisons
Addresses integration test regression in
25f4807df8.
2015-11-19 19:00:34 -08:00
Andrew Gaul 25f4807df8 Tolerate missing or extra quotes in ETags
References andrewgaul/s3proxy#77.
2015-11-19 17:40:48 -08:00
Andrew Gaul 8d87bfc61b Avoid buffering ByteSource when not needed
This allows range requests of large files to work.  Regression from
79fe91bd03.
2015-11-19 15:10:23 -08:00
Andrew Gaul 3c1588527d Delete parts when removing Swift multipart objects
Swift implements multi-part upload with user-visible parts and an
explicit manifest.  When deleting an MPU blob it can delete only the
manifest or both the manifest and parts.  For consistency with other
providers, we now do the latter in the portable abstraction.  Swift
ignores the multipart-manifest=delete parameter for single-part
objects.  Fixes andrewgaul/s3proxy#92.
2015-11-17 23:06:33 -08:00
Zack Shoylev 41ce90ec36 Fixes tests failing on windows filesystems Makes windows behavior more consistent, especially for deletes 2015-11-11 21:01:13 -06:00
Andrew Gaul e0c959c212 Pagination for listing LocalBlobStore MPU parts 2015-10-20 14:01:32 -07:00
Timur Alperovich aaa164179c JCLOUDS-217: Percent encoding changes.
jclouds should not check if the string is encoded, but rather expect
that all strings would be encoded prior to transmission. As part of
that change, we must make sure that no code relies on such behavior
within jclouds. This commit adds a blobstore test to check encoding
pattern for blobs. It also removes the encoding check in the Strings2
class and the related test.
2015-09-08 15:12:14 -07:00
Oliver Gondža edde721937 JCLOUDS-962: Make all @Provider methods final 2015-09-02 23:54:44 +02:00
Timur Alperovich 3757a64abf JCLOUDS-992: LocalBlobStore - use FOLDER for DIR.
Changed the LocalBlobStore to use FOLDER, as opposed to RELATIVE_PATH
when creating directories. Changed the delete keys strategy to treat
FOLDER blobs as regular blobs.
2015-08-20 12:42:11 -07:00
Timur Alperovich 0c5a3db9df JCLOUDS-992: remove special directory handling. 2015-08-20 12:42:11 -07:00
Timur Alperovich 42bfeccdfd Remove last marker test from ListContainerMarker.
Azure does not allow arbitrary marker specification and the generic
testListContainerMarker test should not assume that the behavior is
possible. There is already a separate test for such scenario that is
skipped on Azure.
2015-08-19 16:03:33 -07:00
Roman Coedo 53c3a4918a Fix LocalBlobStore 2015-08-06 09:43:33 -05:00
Roman Coedo 79fe91bd03 JCLOUDS-979: Fix range get for LocalBlobStore 2015-08-04 11:40:57 +02:00
Andrew Gaul 86f47394bf Correct FindBugs violations 2015-07-31 14:53:58 -07:00
Andrew Gaul 7e6284dd86 Add missing equals and hashCode methods
Possible cause of odd PageSet behavior.
2015-07-31 14:17:41 -07:00
Andrew Gaul 5ad245dea5 Do not buffer range get in LocalBlobStore
This avoids OutOfMemoryError with large blobs and enables offsets over
2 GB.
2015-07-27 18:02:54 -07:00
Ka-Hing Cheung 2c578d7bcb marker should be null when there are no more items 2015-07-21 15:46:58 -07:00
Timur Alperovich 19d54369db Propagate delimiter changes to LocalBlobStore.
Propagates the changes to add delimiter support to the local blob
store. The prefix option no longer works with the non-recursive
option. The caller _must_ set the delimiter option to enable the same
functionality.
2015-07-14 14:11:34 -07:00
Timur Alperovich e4161a59bb Move tests to test the file system API.
Move the prefix and delimiter tests from BaseContainerLiveTest to
BaseContainerIntegrationTest, as that class is subclassed in
Filesystem integration tests. This will make sure the file system blob
store will not regress.

The ListContainerTest is updated to _not_ use a file separator
character, as that leads to a possible creation of directories.
Instead, "-" is used as the delimiter for the delimiter option tests.
2015-07-14 14:11:34 -07:00
Timur Alperovich 613b6bf045 Add a test that sets delimiter and prefix.
Expands the delimiter tests to include a test that uses both prefix
and delimiter.
2015-07-14 14:11:34 -07:00
Timur Alperovich 4dc33ab564 JCLOUDS-929: Implement delimiter support in Local.
Adds the delimiter support in the local blob store. The existing
directory implementation is preserved and is not compatible with the
delimiter option, as the existing implementation assumes the usage of
filesystem directories.
2015-07-13 14:34:59 -07:00
Timur Alperovich a29d75a5d1 JCLOUDS-929: Implement generic delimiter support.
The patch adds delimiter option support in the generic blob store
interface. A live integration test is added to verify that jclouds
correctly lists objects separated by a delimiter.
2015-07-13 14:34:58 -07:00
Andrew Gaul 7d7deefb75 JCLOUDS-894: Handle part size when > maximum
Azure has a small part size that was not handled by the existing
logic.  This code is twisty and confusing and should be rewritten!
2015-07-09 18:00:37 -07:00
Zack Shoylev 65b7bdf282 Removes CopyObjectException in favor of jclouds-standard blobstore exceptions 2015-07-09 18:28:14 -05:00
Timur Alperovich 669feb4d0c LocalBlobStore: list marker blobs with delimiters.
When the delimiter option is specified, local blob store should behave
similarly to swift and return the directory marker blobs (directory
blobs) and the common prefix. This undoes the filtering we were
previously doing.
2015-07-07 18:00:31 -07:00
Timur Alperovich 6d27fbb18a JCLOUDS-930: Handle subdir entries correctly.
When listing blobs, Swift returns an array of "subdir" entries for
every common prefix. The openstack-swift provider needs to process
such entries and add them to the result set. The subdir array is an
array of strings, so additional metadata needs to be added to the
objects (bogus ETag, bogus LastModifiedDate, and so on).

When directory marker blobs are used, this means that potential _two_
entries are generated for every directory if:
1. the delimiter is set and matches the directory blob (e.g. dir/ and
   delimiter /)
2. there are objects under the directory name (e.g. dir/blob), which
   will result in results that include common prefixes (subdir)

In the above example, we should expect two results: "dir" and "dir/"
representing the directory marker blob and the common prefix,
respectively.

This is caught in the testDirectory integration test.

The patch changes the behavior of the Swift provider to correctly
handle the results in the subdir stanza and changes the test to expect
the directory marker to be returned in the list.
2015-07-07 17:55:50 -07:00
Timur Alperovich 03248b4c94 JCLOUDS-930: LocalStore -- fixup for prefixes.
When filtering results, we have to consider that a result was added to
the common prefixes list in its entirety (i.e. a directory). Such
results should be filtered out from the delimiter test.

An example that demonstrates this problem is if one creates a
directory "foo" and an object within it called "file". When listing
the results, they will include the directory object "foo" and the
object under "foo/file". During a non-recursive listing, we create a
list of common prefixes ("foo"). Subsequently, jclouds should remove
all objects that include the delimiter ("/"), however, that would not
apply to "foo". With the change to include the delimiter in the
listing, we need to be careful not to return two values "foo" and
"foo/".

A unit test for the local blob store to highlight this problem is
included. An integration test "testDirectory" also catches this issue.
2015-07-07 16:31:04 +02:00
Timur Alperovich 3009da3761 JCLOUDS-930: Expect a trailing "/" in tests.
We should expect a trailing prefix in delimiter tests, as the object
stores will return common prefixes up to and including the delimiter
character.
2015-07-07 16:30:59 +02:00
Timur Alperovich 14087e56bd Relax membership assertion for the prefix test.
Relaxes the membership check in prefix testing. The check is no longer
sensitive to ordering of the results, as different providers may
append, prepend, or insert in sorted order the relative prefixes.
2015-07-06 15:10:29 -07:00
Andrew Gaul bf93cadec6 Use correct default in testPublicAccess
Regression from d57b6e7b8f.
2015-07-02 16:25:49 -07:00
Andrew Gaul bc9cda2e37 JCLOUDS-930: Remove bogus dependsOnMethods 2015-07-02 16:21:03 -07:00
Andrew Gaul d109dd6326 Use prefix instead of marker to list MPU parts 2015-06-30 13:43:01 -07:00
Timur Alperovich aade18b76d JCLOUDS-930: LocalBlobStore -- marker regression.
We should not append a "/" to the marker when returning list results
in the case of directories (RELATIVE_PATH), as the names will already
include the delimiter.

Added a jclouds test to catch such regressions in the local store in
the future.
2015-06-30 08:46:46 -07:00
Timur Alperovich 8677ffcb21 JCLOUDS-930: Implement prefix for LocalBlobStore.
Implements prefix support for the local blob store. The patch allows
for correctly parsing prefixes that may not terminate with a delimiter
(i.e. foo with delimiter "/" and a key foobar/key, should return
foobar/ as the common path) and ones that do (i.e. foo/).

NOTE: there is a small change in behavior in this patch.
LocalBlobStore used to return the common prefixes without the
delimiter character ("/"). However, other providers do include the
delimiter (I checked S3 and Google Cloud Storage) and LocalBlobStore
should include it as well.
2015-06-29 17:31:55 -07:00
Timur Alperovich db4e4e5ba7 Factor out the common prefixes method.
Refactoring the code in the list() method to create a common
extractCommonPrefixes method.
2015-06-29 17:31:55 -07:00
Timur Alperovich 7c7d2e2df6 JCLOUDS-930: Add the prefix option.
Add a prefix option to the ListContainerOptions class.
2015-06-29 17:31:55 -07:00
Timur Alperovich e63474a824 JCLOUDS-931: Sleep only after creating containers.
jclouds should issue the requests to create all of the containers in
the container pool before sleeping. The patch modifies the
createContainerAndEnsureEmpty() method to take an additional
parameter, which specifies whether awaitConsistency() should be called
or not.
2015-06-26 14:04:43 -07:00
Ka-Hing Cheung 8b325d585e object stores typically sort the list of containers 2015-06-24 15:08:23 -07:00
Andrew Gaul d57b6e7b8f Use correct port in testPublicAccess
Also reduce timeout from 20 minutes to 1.
2015-06-24 14:51:16 -07:00
Iván López f155242838 Add missing value in Content-Range header
This is related with #776. It's necessary to add
the 'bytes' string before the bytes.
2015-06-19 08:24:18 +02:00
Andrew Gaul 3a410a25a8 Test for Content-Range header in single range get
Also emit this header in LocalBlobStore.
2015-06-17 11:43:17 -07:00
Andrew Gaul 1f7f8c8c86 Refine HTTP 416 into IllegalArgumentException
Providers yield different messages so remove parsing from test.  Also
narrow exception handling scope.TTP 416 into IllegalArgumentException

Providers yield different messages so remove parsing from test.  Also
narrow exception handling scope.
2015-06-16 21:47:30 -07:00
Andrew Gaul b0dfae1092 Use a configurable timeout for awaitConsistency
This allows setting to zero for strongly-consistency implementations
of s3 and swift stores.
2015-06-15 15:45:17 -07:00
Ka-Hing Cheung 6ed95d8968 fix range get for manifest object
swift doesn't return the etag if the client is doing a range
get of a manifest (SLO or DLO), this fixes SwiftObject so
etag is optional
2015-06-10 13:38:55 -07:00
Ka-Hing Cheung 23ef39416d use awaitConsistency in more places so provider can override it 2015-06-09 23:05:37 -07:00
Ka-Hing Cheung 140fb7ea7b fix multipart put of a blob with content md5
previously the parts will carry the content md5 of the entire
object, because unsetting the md5 of a ContentMetadata actually
didn't do anything
2015-06-09 22:59:30 -07:00
Ka-Hing Cheung 573ceb51c3 metadata and content metadata should have the same length
for range get in a LocalBlobStore, metadata.getSize() has the
original blob size and contentMetadata.getContentLength() has
the actual payload size. Other blobstores have the same size
in both
2015-06-08 14:28:16 -07:00
Andrew Gaul f14514c068 JCLOUDS-894: Add portable multipart upload
This unifies the provider multipart upload code paths and removes code
duplication.
2015-06-06 16:32:16 -07:00
Andrew Gaul 00734ee755 JCLOUDS-894: Move MultipartUploadSlicingAlgorithm to core 2015-06-06 16:32:16 -07:00
Ka-Hing Cheung 1ccdae46fa remove blob uri from transient blobstore
container may not be valid hostnames and the current blob uri
code can fail. there isn't really a way to use uri for transient
blobstore anyway, and removing it is the easier option. for
reference, filesystem blobstore also doesn't do this
2015-05-30 22:24:48 -07:00
Andrew Gaul f19853c278 Revert "metadata and content metadata should have the same length"
This reverts commit bbafc34d46.
2015-05-27 22:19:15 -07:00
Ka-Hing Cheung 1103a778d2 implemented some basic range validations in local blob store
also fixed a range get bug in local blob store
2015-05-27 16:30:05 -07:00
Ka-Hing Cheung bbafc34d46 metadata and content metadata should have the same length
for range get in a LocalBlobStore, metadata.getSize() has the
original blob size and contentMetadata.getContentLength() has
the actual payload size. Other blobstores have the same size
in both
2015-05-26 16:45:34 -07:00
Zack Shoylev f397bebeb2 JCLOUDS-894 Multipart upload code fixes for swift 2015-05-12 19:13:15 -05:00
Andrew Gaul b9c5b5b4e9 JCLOUDS-894: Expose local blobstore multipart operations 2015-05-01 13:07:23 -07:00
Andrew Gaul 71cdba1571 JCLOUDS-894: Expose multipart component operations 2015-05-01 13:07:23 -07:00
Andrew Gaul 40ba156937 JCLOUDS-651: portable copy object content metadata 2015-04-08 17:58:41 -07:00
Andrew Gaul b35295c238 JCLOUDS-651: Add @Beta annotations to copy methods 2015-04-08 17:12:51 -07:00
Ignasi Barrera b6fcac9667 JCLOUDS-651: Fix filesystem integration tests in OSX 2015-04-07 10:53:48 +02:00