Skip navigation
thesimdak
Currently Being Moderated

Client cant show file

Dec 11, 2013 9:09 AM

Tags: #file #client #getchildrenhandler

Hi, I'm trying to do basic things in Adobe Drive SDK. I don't have implemented any server, but I want Adobe Drive Client to show me some "Files" (which in fact doesnt exists). I implemented a GetChildrenHandler and was successfull tu create my own root folder or folder under root folder and so on, but it doesn't work with files. There is a condition in the code, that if a parent is the root, client should create new folder under this root (that works fine). Then, if the folder is not root, I want to tell to client, that it has to show me a file, but this is the part, which doenst work to me. Can you, please, help me? Here is the part of code, which should be done, if parent folder is not root. Thanks

 

String assetId =  parentPath.toString() + "/test.png"

                String parentId = parentPath.toString();

                    Path path = Path.newInstance(assetId);

                UpdateRecipe recipe = response.createFileUpdateRecipe(

                        assetId,

                        path,

                        parentId,

                        1,

                        new ETags());

 

                long lastModified = System.currentTimeMillis();

                long j = 123456;

                Long fileSize = j;

                String comment = null;

                String modificationUser = "User";

                Flags flags = null;

                MimeType mimeType = MimeType.IMAGE_PNG;

                long eTagValue = System.currentTimeMillis();

                recipe.getIdentificationData().getETags().put(DataType.BASIC, new ETag(eTagValue));

                recipe.createBasicData(

                        lastModified,

                        lastModified,

                        fileSize,

                        comment,

                        new User(modificationUser),

                        Visibility.VISIBLE,

                        flags,

                        mimeType,

                        null);

 

And this if from log:

 

2013/12/11 18:04:13,147 [IFSConnection-1] FATAL IFSConnection - NASTY Runtime exception for Request: CREATE

com.adobe.drive.biz.filesystem.FileSystemException: com.adobe.drive.data.persistence.PersistenceException: query did not return a unique result: 2

at com.adobe.drive.internal.biz.filesystem.FileSystemService.runWithTran saction(FileSystemService.java:1762)

at com.adobe.drive.internal.biz.filesystem.FileSystemService.runWithTran saction(FileSystemService.java:1727)

at com.adobe.drive.internal.biz.filesystem.FileSystemService.lookupByPat h(FileSystemService.java:562)

at com.adobe.drive.internal.biz.filesystem.FileSystemService.lookupByPat h(FileSystemService.java:555)

at com.adobe.drive.ifs.job.CreateHandler$1.call(CreateHandler.java:122)

at com.adobe.drive.ifs.job.CreateHandler$1.call(CreateHandler.java:1)

at com.adobe.drive.model.context.Context.run(Context.java:88)

at com.adobe.drive.ifs.internal.IFSConnection.dispatch(IFSConnection.jav a:187)

at com.adobe.drive.ifs.internal.IFSConnection.run(IFSConnection.java:142 )

Caused by: com.adobe.drive.data.persistence.PersistenceException: query did not return a unique result: 2

at com.adobe.drive.data.persistence.PersistenceExceptionFactory.newPersi stenceException(PersistenceExceptionFactory.java:53)

at com.adobe.drive.data.internal.persistence.Query.get(Query.java:67)

at com.adobe.drive.data.persistence.factories.AssetFactory.findAssetByPa rentIdAndName(AssetFactory.java:880)

at com.adobe.drive.data.persistence.factories.AssetFactory.findAssetByPa th(AssetFactory.java:372)

at com.adobe.drive.data.model.asset.AssetFactory.findAssetByPath(AssetFa ctory.java:131)

at com.adobe.drive.internal.data.manager.DataManager.getAsset(DataManage r.java:1612)

at com.adobe.drive.internal.biz.filesystem.FileSystemService$6.execute(F ileSystemService.java:573)

at com.adobe.drive.internal.biz.filesystem.FileSystemService$6.execute(F ileSystemService.java:1)

at com.adobe.drive.internal.biz.filesystem.FileSystemService$FSCallable. run(FileSystemService.java:1793)

at com.adobe.drive.data.internal.persistence.PersistenceRunner$2.runWith Transaction(PersistenceRunner.java:186)

at com.adobe.drive.data.internal.persistence.PersistenceModificationCall able.run(PersistenceModificationCallable.java:71)

at com.adobe.drive.data.internal.persistence.PersistenceRunner.run(Persi stenceRunner.java:119)

at com.adobe.drive.data.internal.persistence.PersistenceRunner.runWithTr ansaction(PersistenceRunner.java:181)

at com.adobe.drive.internal.biz.filesystem.FileSystemService.runWithTran saction(FileSystemService.java:1748)

... 8 more

Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2

at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl. java:820)

at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.j ava:811)

at com.adobe.drive.data.internal.persistence.Query.get(Query.java:63)

... 20 more

 
Replies
  • Currently Being Moderated
    Dec 11, 2013 9:29 AM   in reply to thesimdak

    I would suggest getting assistance from the Adobe Developer Support team for this inquiry if you don’t get a response. This team helps address questions/issues folks are having related to the Adobe Drive SDK. Developer Support is available via membership to the Adobe Technology Partner Program or via an Adobe Developer Support single support incident or bundle of incidents: http://www.adobe.com/support/programs/developer

     

    Are you in the process of creating a custom connector for Adobe Drive that will connect to a particular DAM server or?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points