Artifactory信息中的lastModified和lastUpdated之间有什么区别?
创始人
2024-11-11 00:31:15
0

在Artifactory中,当存储库中的artifact的元数据发生更改时,即使文件内容没有更改,也会更新相关信息。这些信息包括'lastModified”和'lastUpdated”。

'lastModified”代表文件的最后修改时间戳,指的是在存储库中上载artifact文件的时间戳。

'lastUpdated”代表元数据的最后修改时间戳,指的是存储库元数据上次更新的时间戳。

以下是Java代码示例,可以使用Artifactory API来获取artifact的最后修改时间戳和元数据的最后修改时间戳:

import org.jfrog.artifactory.client.Artifactory;
import org.jfrog.artifactory.client.ArtifactoryClient;
import org.jfrog.artifactory.client.ArtifactoryRequest;
import org.jfrog.artifactory.client.ArtifactoryResponse;

public class ArtifactoryExample {
    public static void main(String[] args) {
        String repoUrl = "http://localhost:8081/artifactory";
        String repoName = "libs-release-local";
        String artifactPath = "com/example/my-library/1.0.0/my-library-1.0.0.jar";
        
		// Create Artifactory client
        Artifactory artifactory = ArtifactoryClient.create(repoUrl, "username", "password");

        // Request the artifact info
        ArtifactoryRequest request = new ArtifactoryRequest.Builder()
                .method(ArtifactoryRequest.Method.GET)
                .apiUrl(String.format("%s/%s/%s", repoUrl, repoName, artifactPath))
                .build();
        ArtifactoryResponse response = artifactory.restCall(request);

        // Get the last modified and last updated timestamps
        long lastModified = response.getLastModified();
        long lastUpdated = response.getLastUpdated();
        
        System.out.println("Last Modified: " + lastModified);
        System.out.println("Last Updated: " + lastUpdated);
    }
}

相关内容

热门资讯

安卓换鸿蒙系统会卡吗,体验流畅... 最近手机圈可是热闹非凡呢!不少安卓用户都在议论纷纷,说鸿蒙系统要来啦!那么,安卓手机换上鸿蒙系统后,...
iwatch怎么连接安卓系统,... 你有没有想过,那款时尚又实用的iWatch,竟然只能和iPhone好上好?别急,今天就来给你揭秘,怎...
iphone系统与安卓系统更新... 最近是不是你也遇到了这样的烦恼?手机更新系统总是失败,急得你团团转。别急,今天就来给你揭秘为什么iP...
安卓系统怎么连不上carlif... 安卓系统无法连接CarLife的原因及解决方法随着智能手机的普及,CarLife这一车载互联功能为驾...
app安卓系统登录不了,解锁登... 最近是不是你也遇到了这样的烦恼:手机里那个心爱的APP,突然就登录不上了?别急,让我来帮你一步步排查...
安卓系统拦截短信在哪,安卓系统... 你是不是也遇到了这种情况:手机里突然冒出了很多垃圾短信,烦不胜烦?别急,今天就来教你怎么在安卓系统里...
windows官网系统多少钱 Windows官网系统价格一览:了解正版Windows的购买成本Windows 11官方价格解析微软...
oppo手机安卓系统换成苹果系... OPPO手机安卓系统换成苹果系统:现实吗?如何操作?随着智能手机市场的不断发展,用户对于手机系统的需...
安卓平板改windows 系统... 你有没有想过,你的安卓平板电脑是不是也能变身成Windows系统的超级英雄呢?想象在同一个设备上,你...
安卓系统要维护多久,安卓系统维... 你有没有想过,你的安卓手机里那个陪伴你度过了无数日夜的安卓系统,它究竟要陪伴你多久呢?这个问题,估计...