org.apache.jackrabbit.oak.spi.blob.BlobStore.getReference()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.apache.jackrabbit.oak.spi.blob.BlobStore.getReference()方法的一些代码示例,展示了BlobStore.getReference()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlobStore.getReference()方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.spi.blob.BlobStore
类名称:BlobStore
方法名:getReference

BlobStore.getReference介绍

[英]Returns a secure reference to blob referred by blobid, or null if no such reference is available.
[中]

代码示例

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Override @Nullable
public String getReference() {
  return blobStore.getReference(blobId);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override @Nullable
public String getReference() {
  return blobStore.getReference(blobId);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override @CheckForNull
public String getReference() {
  return blobStore.getReference(blobId);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public String getReference(String blobId) {
  try {
    if (isMigrated(blobId)) {
      return NEW_BLOBSTORE_PREFIX + newBlobStore.getReference(blobId);
    } else {
      return OLD_BLOBSTORE_PREFIX + oldBlobStore.getReference(blobId);
    }
  } catch (IOException e) {
    log.error("Can't get reference", e);
    return null;
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public String getReference(String blobId) {
  try {
    if (isMigrated(blobId)) {
      return NEW_BLOBSTORE_PREFIX + newBlobStore.getReference(blobId);
    } else {
      return OLD_BLOBSTORE_PREFIX + oldBlobStore.getReference(blobId);
    }
  } catch (IOException e) {
    log.error("Can't get reference", e);
    return null;
  }
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob

@Override
public String getReference(String blobId) {
  try {
    if (isMigrated(blobId)) {
      return NEW_BLOBSTORE_PREFIX + newBlobStore.getReference(blobId);
    } else {
      return OLD_BLOBSTORE_PREFIX + oldBlobStore.getReference(blobId);
    }
  } catch (IOException e) {
    log.error("Can't get reference", e);
    return null;
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
@Nullable
public String getReference() {
  String blobId = getBlobId();
  if (blobId != null) {
    if (blobStore != null) {
      return blobStore.getReference(blobId);
    } else {
      throw new IllegalStateException("Attempt to read external blob with blobId [" + blobId + "] " +
          "without specifying BlobStore");
    }
  }
  return null;
}

代码示例来源:origin: apache/jackrabbit-oak

@SuppressWarnings("ConstantConditions")
@Test(expected = NullPointerException.class)
public void getReferenceShouldThrowAnExceptionWhenNullIsPassed() {
  given:
  {
    final BlobStore blobStore = new LoopbackBlobStore();
    when:
    {
      blobStore.getReference(null);
    }
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Test
@Parameters(method = "blobIds")
public void getReferenceShouldReturnTheSameValuePassedExceptOfNull(
    final String blobId) {
  given:
  {
    final BlobStore blobStore = new LoopbackBlobStore();
    where:
    {
      expect:
      {
        assertEquals(blobId, blobStore.getReference(blobId));
      }
    }
  }
}

相关文章