Highlighted
gangstead
1 Nickel

Java API createAccessToken file name restrictions

Jump to solution

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?

0 Kudos
1 Solution

Accepted Solutions
gangstead
1 Nickel

Re: Re: Java API createAccessToken file name restrictions

Jump to solution

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());

0 Kudos
4 Replies
8 Krypton

Re: Java API createAccessToken file name restrictions

Jump to solution

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.

gangstead
1 Nickel

Re: Java API createAccessToken file name restrictions

Jump to solution

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.

0 Kudos
gangstead
1 Nickel

Re: Java API createAccessToken file name restrictions

Jump to solution

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.

0 Kudos
gangstead
1 Nickel

Re: Re: Java API createAccessToken file name restrictions

Jump to solution

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());

0 Kudos