Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1392

August 16th, 2013 13:00

Java API createAccessToken file name restrictions

Using the Java API 2.1.3 I can create, edit and delete files and directories with spaces in them, but I can't create an access token.  I'm using the namespace interface.

I get Atmos error code 1002: One or more arguments in the request were invalid.

This comes back from an http 400 from Atmos.

For example I have two files uploaded:

/foo/bang/test_upload.txt

/foo/bang/test upload.txt

I uploaded both files via the Java API, I can also view them in the Atmos Chrome extension.  When I call createAccessToken on each of them ( using the same Policy and no ACL) I get the 1002 error on the one with the space in the name.  Is there a problem in the atmos-java project or with Atmos itself?

5 Posts

August 19th, 2013 16:00

Since the bug is in creating an access token by filepath I did a work around by looking up the object ID.  It adds an extra service call, but at least it works.

ObjectInfo oi = atmosApi.getObjectInfo(new ObjectPath(path));

CreateAccessTokenRequest request = new CreateAccessTokenRequest();

request.setIdentifier(oi.getObjectId());

110 Posts

August 16th, 2013 14:00

Although I cannot reproduce this problem with spaces, I can produce that error with other special characters (like '#').  This appears to be a bug in the Java SDK.  Can you open an issue in google code?  I have a fix ready, but there is some other work that must be finished before it can be released.

5 Posts

August 16th, 2013 15:00

Thanks for the quick response.  I've created the issue 12 on google code https://code.google.com/p/atmos-java/issues/detail?id=12.  I'll mark as completed when it's fixed.

5 Posts

August 19th, 2013 11:00

Thanks I see r208 on the Google Code base: https://code.google.com/p/atmos-java/source/detail?r=208

I downloaded the updated source from SVN, built the new jar and included it and I'm still getting the same error.

No Events found!

Top