package com.perforce.workshop.tjuricek.p4java_ext; import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.server.IOptionsServer; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Access to the "p4 files" command */ public interface P4Files extends P4Connection, P4Errors { static P4Files create(P4Connection conn) { return new DefaultP4Files(conn); } /** * Returns the result of "p4 files //path...@=id" * * @param path If non-null, will use this path selector to trim down the path, otherwise, will * use "//..." with the revision specifier * @param changeId The specific change ID that eventually is used to specify the selected * path in "//...@=ID" syntax * @return The list of FileSummary objects */ default List<FileSummary> listChangelist(String path, String changeId) { try { if (path == null) { path = "//..."; } String[] opts = new String[]{path + "@=" + changeId}; IOptionsServer server = getOptionsServer(); Map<String, Object>[] results = server.execMapCmd("files", opts, null); checkError(results); List<FileSummary> summaries = new ArrayList<FileSummary>(); for (Map<String, Object> map : results) { summaries.add(new FileSummary(map)); } return summaries; } catch (P4JavaException p4) { throw new P4Exception(p4); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 9156 | tjuricek | p4java_ext 0.1.1: Added basic "list" method to the P4Files interface | ||
#1 | 9086 | tjuricek |
0.1.0 Initial release of p4java_ext Mostly just contains enough of the P4 API to build the test data initializer. About 4 commands have minimal testing, so it works. Kind of. |
||
//guest/tjuricek/p4java_ext/src/main/java/com/perforce/p4java_ext/P4Files.java | |||||
#1 | 9085 | tjuricek | First import of the project, before package refactoring. |