com.google.cloud.storage.Blob.getUpdateTime()方法的使用及代码示例

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

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

Blob.getUpdateTime介绍

暂无

代码示例

代码示例来源:origin: googleapis/google-cloud-java

System.out.println("StorageClass: " + blob.getStorageClass());
System.out.println("TimeCreated: " + new Date(blob.getCreateTime()));
System.out.println("Last Metadata Update: " + new Date(blob.getUpdateTime()));
Boolean temporaryHoldIsEnabled = (blob.getTemporaryHold() != null && blob.getTemporaryHold());
System.out.println("temporaryHold: " + (temporaryHoldIsEnabled ? "enabled" : "disabled"));

代码示例来源:origin: apache/nifi

do {
  for (Blob blob : blobPages.getValues()) {
    long lastModified = blob.getUpdateTime();
    if (lastModified < currentTimestamp
        || lastModified == currentTimestamp && currentKeys.contains(blob.getName())) {
    if (blob.getUpdateTime() != null) {
      attributes.put(UPDATE_TIME_ATTR, String.valueOf(blob.getUpdateTime()));

代码示例来源:origin: apache/nifi

if (blob.getUpdateTime() != null) {
  attributes.put(UPDATE_TIME_ATTR, String.valueOf(blob.getUpdateTime()));

代码示例来源:origin: apache/nifi

if (blob.getUpdateTime() != null) {
  attributes.put(UPDATE_TIME_ATTR, String.valueOf(blob.getUpdateTime()));

代码示例来源:origin: googleapis/google-cloud-java

assertEquals(SELF_LINK, blob.getSelfLink());
assertEquals(SIZE, blob.getSize());
assertEquals(UPDATE_TIME, blob.getUpdateTime());
assertEquals(storage.getOptions(), blob.getStorage().getOptions());
assertFalse(blob.isDirectory());
assertNull(blob.getSelfLink());
assertEquals(0L, (long) blob.getSize());
assertNull(blob.getUpdateTime());
assertTrue(blob.isDirectory());

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

private static String getLastModifiedTimestamp(Blob blob) {
 if (blob.isDirectory()) {
  return "-";
 }
 SimpleDateFormat dateFormat = new SimpleDateFormat("M/d/yy h:mm a");
 return dateFormat.format(new Date(blob.getUpdateTime()));
}

代码示例来源:origin: spring-cloud/spring-cloud-gcp

@Override
public long lastModified() throws IOException {
  return throwExceptionForNullBlob(getBlob()).getUpdateTime();
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-gcp-storage

@Override
public long lastModified() throws IOException {
  return throwExceptionForNullBlob(getBlob()).getUpdateTime();
}

代码示例来源:origin: ai.h2o/h2o-persist-gcs

/**
 * Lists Blobs prefixed with `path`.
 * Prefix `path` is removed from the name of returned entries.
 * e.g.
 * If `path` equals gs://bucket/infix and 2 Blobs exist: "gs://bucket/infix/blob1, gs://bucket/infix/blob2,
 * the returned array contains of Persist Entries with names set to blob1 and blob2, respectively.
 */
@Override
public PersistEntry[] list(String path) {
 final String bk[] = split(path);
 int substrLen = bk.length == 2 ? bk[1].length() : 0;
 List<PersistEntry> results = new ArrayList<>();
 try {
  for (Blob b : storageProvider.getStorage().list(bk[0]).iterateAll()) {
   if (bk.length == 1 || (bk.length == 2 && b.getName().startsWith(bk[1]))) {
    String relativeName = b.getName().substring(substrLen);
    if (relativeName.startsWith("/")) {
     relativeName = relativeName.substring(1);
    }
    results.add(new PersistEntry(relativeName, b.getSize(), b.getUpdateTime()));
   }
  }
 } catch (StorageException e) {
  Log.err(e);
 }
 return results.toArray(new PersistEntry[results.size()]);
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

@Before
public void setUp() {
 GcsTestUtils.setupVirtualFileWithBucketMocks(bucketVirtualFile);
 when(loginService.isLoggedIn()).thenReturn(true);
 when(directoryBlob.isDirectory()).thenReturn(true);
 when(directoryBlob.getName()).thenReturn(DIR_NAME);
 when(binaryBlob.isDirectory()).thenReturn(false);
 when(binaryBlob.getName()).thenReturn(BLOB_NAME);
 when(binaryBlob.getSize()).thenReturn(1024L);
 when(binaryBlob.getContentType()).thenReturn(BLOB_CONTENT_TYPE);
 when(binaryBlob.getUpdateTime()).thenReturn(0L);
 when(binaryBlobInDirectory.getName()).thenReturn(NESTED_BLOB_FULL_NAME);
 // TODO: consider shutting down timer instead when clear what is creating the timer.
 ThreadTracker.longRunningThreadCreated(ApplicationManager.getApplication(), "Timer-0");
}

相关文章