@Test public void testFreezeVersionWithBlobWithRevision() throws Exception { SimpleManagedBlob blob = createBlob(UUID.randomUUID().toString()); ManagedBlob newBlob = blobProvider.freezeVersion(blob, null); assertNull(newBlob); }
@Override public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException { LiveConnectFileInfo fileInfo = toFileInfo(blob); if (fileInfo.getRevisionId().isPresent()) { return null; } BoxFile.Info boxFileInfo = retrieveBoxFileInfo(fileInfo); putFileInCache(new BoxLiveConnectFile(fileInfo, boxFileInfo)); String revisionId = boxFileInfo.getVersion().getVersionID(); fileInfo = new LiveConnectFileInfo(fileInfo.getUser(), fileInfo.getFileId(), revisionId); BoxLiveConnectFile file = new BoxLiveConnectFile(fileInfo, boxFileInfo); return toBlob(file); }
BoxBlobProvider extends AbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider> { @Override public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException { LiveConnectFileInfo fileInfo = toFileInfo(blob); if (fileInfo.getRevisionId().isPresent()) { return null; } BoxFile.Info boxFileInfo = retrieveBoxFileInfo(fileInfo); putFileInCache(new BoxLiveConnectFile(fileInfo, boxFileInfo)); String revisionId = boxFileInfo.getVersion().getVersionID(); fileInfo = new LiveConnectFileInfo(fileInfo.getUser(), fileInfo.getFileId(), revisionId); BoxLiveConnectFile file = new BoxLiveConnectFile(fileInfo, boxFileInfo); return toBlob(file); } }
BoxBlobProvider extends AbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider> { @Override public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException { LiveConnectFileInfo fileInfo = toFileInfo(blob); if (fileInfo.getRevisionId().isPresent()) { return null; } BoxFile.Info boxFileInfo = retrieveBoxFileInfo(fileInfo); putFileInCache(new BoxLiveConnectFile(fileInfo, boxFileInfo)); String revisionId = boxFileInfo.getVersion().getVersionID(); fileInfo = new LiveConnectFileInfo(fileInfo.getUser(), fileInfo.getFileId(), revisionId); BoxLiveConnectFile file = new BoxLiveConnectFile(fileInfo, boxFileInfo); return toBlob(file); }  }
BoxBlobProvider extends AbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider> { @Override public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException { LiveConnectFileInfo fileInfo = toFileInfo(blob); if (fileInfo.getRevisionId().isPresent()) { return null; } BoxFile.Info boxFileInfo = retrieveBoxFileInfo(fileInfo); putFileInCache(new BoxLiveConnectFile(fileInfo, boxFileInfo)); String revisionId = boxFileInfo.getVersion().getVersionID(); fileInfo = new LiveConnectFileInfo(fileInfo.getUser(), fileInfo.getFileId(), revisionId); BoxLiveConnectFile file = new BoxLiveConnectFile(fileInfo, boxFileInfo); return toBlob(file); }  @Override String getPageProviderNameForUpdate(); @Override URI getURI(ManagedBlob blob, UsageHint usage, HttpServletRequest servletRequest); @Override InputStream getStream(ManagedBlob blob); @Override InputStream getThumbnail(ManagedBlob blob); @Override ManagedBlob freezeVersion(ManagedBlob blob, Document doc); }
BoxBlobProvider extends AbstractLiveConnectBlobProvider<BoxOAuth2ServiceProvider> { @Override public ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException { LiveConnectFileInfo fileInfo = toFileInfo(blob); if (fileInfo.getRevisionId().isPresent()) { return null; } BoxFile.Info boxFileInfo = retrieveBoxFileInfo(fileInfo); putFileInCache(new BoxLiveConnectFile(fileInfo, boxFileInfo)); String revisionId = boxFileInfo.getVersion().getVersionID(); fileInfo = new LiveConnectFileInfo(fileInfo.getUser(), fileInfo.getFileId(), revisionId); BoxLiveConnectFile file = new BoxLiveConnectFile(fileInfo, boxFileInfo); return toBlob(file); }  @Override String getPageProviderNameForUpdate(); @Override URI getURI(ManagedBlob blob, UsageHint usage, HttpServletRequest servletRequest); @Override InputStream getStream(ManagedBlob blob); @Override InputStream getThumbnail(ManagedBlob blob); @Override ManagedBlob freezeVersion(ManagedBlob blob, Document doc);  }