Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Platform.currentTimeMillis()


                index().stage(getProgressListener(), diff, 0);

                // write new tree
                ObjectId newTreeId = command(WriteTree2.class).call();

                long timestamp = platform.currentTimeMillis();
                // Create new commit
                CommitBuilder builder = new CommitBuilder(commitToApply);
                builder.setParentIds(Arrays.asList(rebaseHead));
                builder.setTreeId(newTreeId);
                builder.setCommitterTimestamp(timestamp);
View Full Code Here


            }
        } else {
            // write new tree
            ObjectId newTreeId = command(WriteTree2.class).call();

            long timestamp = platform.currentTimeMillis();
            // Create new commit
            CommitBuilder builder = new CommitBuilder(commitToApply);
            builder.setParentIds(Arrays.asList(rebaseHead));
            builder.setTreeId(newTreeId);
            builder.setCommitterTimestamp(timestamp);
View Full Code Here

        String taggerName = name.get();
        String taggerEmail = email.get();

        Platform platform = platform();
        long taggerTimeStamp = platform.currentTimeMillis();
        int taggerTimeZoneOffset = platform.timeZoneOffset(taggerTimeStamp);
        return new RevPersonImpl(taggerName, taggerEmail, taggerTimeStamp, taggerTimeZoneOffset);
    }

}
View Full Code Here

        if (!enabled.booleanValue()) {
            return command;
        }

        final Platform platform = command.context().platform();
        final long startTime = platform.currentTimeMillis();
        final long nanoTime = platform.nanoTime();
        final String name = command.getClass().getSimpleName();
        CallStack stack = CallStack.push(name, startTime, nanoTime);
        command.getClientData().put("metrics.callStack", stack);
        return command;
View Full Code Here

        final Platform platform = platform();
        if (string.equals("yesterday")) { // return the beginning of yesterday, not just 24h ago
                                          // from current time
            try {
                formatter = new SimpleDateFormat("dd/MM/yyyy");
                Date today = new Date(platform.currentTimeMillis());
                long todayOnlyDate = formatter.parse(formatter.format(today)).getTime();
                long millisecsInOneDay = 60 * 60 * 24 * 1000;
                long yesterday = todayOnlyDate - millisecsInOneDay;
                return yesterday;
            } catch (ParseException e) {
View Full Code Here

        }

        if (string.equals("today")) {
            try {
                formatter = new SimpleDateFormat("dd/MM/yyyy");
                Date today = new Date(platform.currentTimeMillis());
                long todayOnlyDate = formatter.parse(formatter.format(today)).getTime();
                return todayOnlyDate;
            } catch (ParseException e) {
                // shouldn't reach this
            }
View Full Code Here

        // parse it as a git-like time reference
        String[] tokens = string.split("\\.");
        if (tokens.length % 2 != 0) {
            if (tokens[tokens.length - 1].toLowerCase().equals("ago")) {
                long currentTime = platform.currentTimeMillis();
                int i;
                for (i = 0; i < tokens.length - 1; i++) {
                    try {
                        double number = Double.parseDouble(tokens[i]);
                        i++;
View Full Code Here

        builder.setParentIds(Lists.newArrayList(filteredParents));
        builder.setTreeId(endTree);
        if (message == null) {
            message = since.getMessage();
        }
        long timestamp = platform.currentTimeMillis();
        builder.setMessage(message);
        builder.setCommitter(resolveCommitter());
        builder.setCommitterEmail(resolveCommitterEmail());
        builder.setCommitterTimestamp(timestamp);
        builder.setCommitterTimeZoneOffset(platform.timeZoneOffset(timestamp));
View Full Code Here

                            }
                        }
                    });
            builder.setParentIds(Lists.newArrayList(parents));
            builder.setTreeId(commit.getTreeId());
            long timestamp = platform.currentTimeMillis();
            builder.setCommitterTimestamp(timestamp);
            builder.setCommitterTimeZoneOffset(platform.timeZoneOffset(timestamp));

            RevCommit newCommit = builder.build();
            replacedCommits.put(commit.getId(), newCommit.getId());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.