本文整理汇总了Java中org.springframework.shell.support.util.OsUtils.LINE_SEPARATOR属性的典型用法代码示例。如果您正苦于以下问题:Java OsUtils.LINE_SEPARATOR属性的具体用法?Java OsUtils.LINE_SEPARATOR怎么用?Java OsUtils.LINE_SEPARATOR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.shell.support.util.OsUtils
的用法示例。
在下文中一共展示了OsUtils.LINE_SEPARATOR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printStarSystemTable
public String printStarSystemTable(StarSystem starSystem) {
String out = "";
Date start = new Date();
List<Station> stations = stationService.getStationsForSystemOrientDb(starSystem.getName());
List<Map<String, Object>> tableData = stations.stream().map(station -> {
Map<String, Object> tableRow = new HashMap<>();
tableRow.put("STATION", station.getName());
tableRow.put("BLACK MARKET", station.getBlackMarket());
tableRow.put("DAYS OLD", (new Date().getTime() - station.getDate()) / 1000 / 60 / 60 / 24);
return tableRow;
}).collect(Collectors.toList());
out += OsUtils.LINE_SEPARATOR;
out += "SYSTEM: " + starSystem.getName() + " @ " + starSystem.getX() + ", " + starSystem.getY() + ", " + starSystem.getZ() + OsUtils.LINE_SEPARATOR;
out += OsUtils.LINE_SEPARATOR + TableRenderer.renderMapDataAsTable(tableData, ImmutableList.of("STATION", "BLACK MARKET", "DAYS OLD"));
out += OsUtils.LINE_SEPARATOR + "executed in " + (new Date().getTime() - start.getTime()) / 1000.0 + " seconds.";
return out;
}
示例2: generateLine
protected String generateLine(int maxlineLength, int pad, String message) {
String out = "";
String padS = "";
for (int i = 0; i < pad; i++) {
padS += " ";
}
String messageFormatted = "";
if (message.length() > maxlineLength) {
messageFormatted += message.substring(0, maxlineLength);
} else {
messageFormatted += message;
for (int i = 0; i < ((maxlineLength) - message.length()); i++) {
messageFormatted += " ";
}
}
out += "|" + padS + messageFormatted + padS + "|" + OsUtils.LINE_SEPARATOR;
return out;
}
示例3: listContactSettings
@Test
public void listContactSettings() throws Exception {
String url = "/geoserver/rest/settings/contact.xml";
whenHttp(server).match(get(url)).then(stringContent(getResourceString("contactSettings.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
SettingsCommands commands = new SettingsCommands();
commands.setGeoserver(geoserver);
String actual = commands.listContact();
String expected = "City: Somewhere" + OsUtils.LINE_SEPARATOR +
"Country: USA" + OsUtils.LINE_SEPARATOR +
"Type: Home" + OsUtils.LINE_SEPARATOR +
"Email: [email protected]" + OsUtils.LINE_SEPARATOR +
"Organization: Geoserver" + OsUtils.LINE_SEPARATOR +
"Name: John Doe" + OsUtils.LINE_SEPARATOR +
"Position: Map Maker" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri(url));
}
示例4: manifestGet
@Test
public void manifestGet() throws Exception {
whenHttp(server).match(get("/geoserver/rest/about/manifests.xml")).then(stringContent(getResourceString("manifests.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
AboutCommands commands = new AboutCommands();
commands.setGeoserver(geoserver);
String actual = commands.manifestGet("gt-xsd-ows-9.1");
String expected = "gt-xsd-ows-9.1" + OsUtils.LINE_SEPARATOR +
" Manifest-Version: 1.0" + OsUtils.LINE_SEPARATOR +
" Archiver-Version: Plexus Archiver" + OsUtils.LINE_SEPARATOR +
" Built-By: jetty" + OsUtils.LINE_SEPARATOR +
" Build-Timestamp: 20-Apr-2013 11:03" + OsUtils.LINE_SEPARATOR +
" Git-Revision: f25b08094d1bf7e0949994f4971bc21fb117d37b" + OsUtils.LINE_SEPARATOR +
" Build-Jdk: 1.6.0_22" + OsUtils.LINE_SEPARATOR +
" Project-Version: 9.1" + OsUtils.LINE_SEPARATOR +
" Created-By: Apache Maven" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/about/manifests.xml"));
}
示例5: getDataStore
@Test
public void getDataStore() throws Exception {
String url = "/geoserver/rest/workspaces/topp/datastores/taz_shapes.xml";
whenHttp(server).match(get(url)).then(stringContent(getResourceString("datastore.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
DataStoreCommands commands = new DataStoreCommands();
commands.setGeoserver(geoserver);
String actual = commands.get("topp", "taz_shapes");
String expected = "taz_shapes" + OsUtils.LINE_SEPARATOR +
" Enabled? true" + OsUtils.LINE_SEPARATOR +
" Description: null" + OsUtils.LINE_SEPARATOR +
" Store Type: null" + OsUtils.LINE_SEPARATOR +
" Type: UNKNOWN" + OsUtils.LINE_SEPARATOR +
" Workspace: topp" + OsUtils.LINE_SEPARATOR +
" Connection Parameters:" + OsUtils.LINE_SEPARATOR +
" namespace: http://www.openplans.org/topp" + OsUtils.LINE_SEPARATOR +
" url: file:data/taz_shapes" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri(url));
}
示例6: fontList
@Test
public void fontList() throws Exception {
whenHttp(server).match(get("/geoserver/rest/fonts.xml")).then(stringContent(getResourceString("fonts.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
FontCommands commands = new FontCommands();
commands.setGeoserver(geoserver);
String actual = commands.list(null);
String expected = "Bordeaux Roman Bold LET" + OsUtils.LINE_SEPARATOR +
"Bradley Hand ITC TT" + OsUtils.LINE_SEPARATOR +
"Didot-Bold" + OsUtils.LINE_SEPARATOR +
"GillSans-Light" + OsUtils.LINE_SEPARATOR +
"HiraMinPro-W3" + OsUtils.LINE_SEPARATOR +
"LiHeiPro" + OsUtils.LINE_SEPARATOR +
"Lucida Bright Demibold Italic" + OsUtils.LINE_SEPARATOR +
"LucidaSans" + OsUtils.LINE_SEPARATOR +
"Palatino" + OsUtils.LINE_SEPARATOR +
"Skia-Regular_Light-Condensed" + OsUtils.LINE_SEPARATOR +
"StoneSansITCTT-SemiIta" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/fonts.xml"));
}
示例7: getPrompt
@Override
public String getPrompt() {
String prompt = "[";
if (stationService.getUserLastStoredStation() != null) {
prompt += stationService.getUserLastStoredStation().getName() + "@";
}
if (!StringUtils.isEmpty(starSystemService.getUserLastStoredSystem())) {
prompt += starSystemService.getUserLastStoredSystem();
}
return OsUtils.LINE_SEPARATOR + prompt + "]--Jarvis>";
}
示例8: stationDetailsOrientDb
public String stationDetailsOrientDb(Station station) {
OrientGraph graph = null;
List<Commodity> stationCommodities = new ArrayList<>();
try {
graph = orientDbService.getFactory().getTx();
OrientVertex stationVertex = (OrientVertex) graph.getVertexByKey("Station.name", station.getName());
stationCommodities = getStationCommodities(stationVertex);
graph.commit();
} catch (Exception e) {
if (graph != null) {
graph.rollback();
}
}
// build the map so that you can create a table
List<Map<String, Object>> tableData = stationCommodities.stream().map(Commodity::toMap).sorted((row1,row2)->{
String group1 = (String) row1.get("GROUP");
String group2 = (String) row2.get("GROUP");
String comm1 = (String) row1.get("COMMODITY");
String comm2 = (String) row2.get("COMMODITY");
if (group1.equals(group2)) {
return comm1.compareTo(comm2);
}
return group1.compareTo(group2);
}).collect(Collectors.toList());
String out = "";
out += "System: " +station.getSystem() + OsUtils.LINE_SEPARATOR;
out += "Station: " +station.getName() + OsUtils.LINE_SEPARATOR;
out += "Black Market: " +station.getBlackMarket() + OsUtils.LINE_SEPARATOR;
out += "Data Age in Days: " + tableData.get(0).get("DAYS OLD") + OsUtils.LINE_SEPARATOR + OsUtils.LINE_SEPARATOR;
out += TableRenderer.renderMapDataAsTable(tableData, ImmutableList.of("GROUP", "COMMODITY", "BUY @", "SUPPLY", "SELL @", "DEMAND"));
return out;
}
示例9: generateTableHead
protected String generateTableHead(int lineLength, int pad) {
String tableHead = "+";
for (int i = 0; i < lineLength + (pad * 2); i++) {
tableHead += "-";
}
tableHead += "+" + OsUtils.LINE_SEPARATOR;
return tableHead;
}
示例10: getBanner
public String getBanner() {
String s = "=======================================" + OsUtils.LINE_SEPARATOR;
s += "* *" + OsUtils.LINE_SEPARATOR;
s += "* " + Constants.APP_TITLE + " *" + OsUtils.LINE_SEPARATOR;
s += "* *" + OsUtils.LINE_SEPARATOR;
s += "=======================================" + OsUtils.LINE_SEPARATOR;
s += "Version: " + this.getVersion();
return s;
}
示例11: listWps
@Test
public void listWps() throws Exception {
whenHttp(server).match(get("/geoserver/rest/scripts/wps.json")).then(stringContent(getResourceString("scripts.json")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
ScriptCommands commands = new ScriptCommands();
commands.setGeoserver(geoserver);
String actual = commands.listWps();
String expected = "buffer.groovy" + OsUtils.LINE_SEPARATOR + "merge.groovy" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/scripts/wps.json"));
}
示例12: listAllCoverageStores
@Test
public void listAllCoverageStores() throws Exception {
String url1 = "/geoserver/rest/workspaces/it.geosolutions/coveragestores.xml";
whenHttp(server).match(get(url1)).then(stringContent(getResourceString("coveragestores.xml")), status(HttpStatus.OK_200));
String url2 = "/geoserver/rest/workspaces/topp/coveragestores.xml";
whenHttp(server).match(get(url2)).then(stringContent(getResourceString("coveragestores.xml")), status(HttpStatus.OK_200));
String url3 = "/geoserver/rest/workspaces/cite/coveragestores.xml";
whenHttp(server).match(get(url3)).then(stringContent(getResourceString("coveragestores.xml")), status(HttpStatus.OK_200));
String workspaceUrl = "/geoserver/rest/workspaces.xml";
whenHttp(server).match(get(workspaceUrl)).then(stringContent(getResourceString("workspaces.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
CoverageStoreCommands commands = new CoverageStoreCommands();
commands.setGeoserver(geoserver);
String actual = commands.list(null);
String expected = "cite" + OsUtils.LINE_SEPARATOR +
"----" + OsUtils.LINE_SEPARATOR +
"arcGridSample" + OsUtils.LINE_SEPARATOR +
"mosaic" + OsUtils.LINE_SEPARATOR +
"" + OsUtils.LINE_SEPARATOR +
"it.geosolutions" + OsUtils.LINE_SEPARATOR +
"---------------" + OsUtils.LINE_SEPARATOR +
"arcGridSample" + OsUtils.LINE_SEPARATOR +
"mosaic" + OsUtils.LINE_SEPARATOR +
"" + OsUtils.LINE_SEPARATOR +
"topp" + OsUtils.LINE_SEPARATOR +
"----" + OsUtils.LINE_SEPARATOR +
"arcGridSample" + OsUtils.LINE_SEPARATOR +
"mosaic" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri(url1));
verifyHttp(server).once(method(Method.GET), uri(url2));
verifyHttp(server).once(method(Method.GET), uri(url3));
verifyHttp(server).once(method(Method.GET), uri(workspaceUrl));
}
示例13: listWmsSettings
@Test
public void listWmsSettings() throws Exception {
String url = "/geoserver/rest/services/wms/settings.xml";
whenHttp(server).match(get(url)).then(stringContent(getResourceString("wms.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
OWSCommands commands = new OWSCommands();
commands.setGeoserver(geoserver);
String actual = commands.wmsList(null);
String expected = "WMS" + OsUtils.LINE_SEPARATOR +
" Enabled: true" + OsUtils.LINE_SEPARATOR +
" Cite Compliant: false" + OsUtils.LINE_SEPARATOR +
" Schema Base URL: http://schemas.opengis.net" + OsUtils.LINE_SEPARATOR +
" Verbose: false" + OsUtils.LINE_SEPARATOR +
" Interpolation: Nearest" + OsUtils.LINE_SEPARATOR +
" Max Buffer: 0" + OsUtils.LINE_SEPARATOR +
" Max Request Memory: 0" + OsUtils.LINE_SEPARATOR +
" Max Rendering Time: 0" + OsUtils.LINE_SEPARATOR +
" Max Rendering Errors: 0" + OsUtils.LINE_SEPARATOR +
" Watermark:" + OsUtils.LINE_SEPARATOR +
" Enabled: false" + OsUtils.LINE_SEPARATOR +
" Position: BOT_RIGHT" + OsUtils.LINE_SEPARATOR +
" Transparency: 100" + OsUtils.LINE_SEPARATOR +
" Versions:" + OsUtils.LINE_SEPARATOR +
" 1.1.1" + OsUtils.LINE_SEPARATOR +
" 1.3.0" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri(url));
}
示例14: listSession
@Test
public void listSession() throws Exception {
whenHttp(server).match(get("/geoserver/rest/sessions")).then(stringContent(getResourceString("sessions.json")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
ScriptCommands commands = new ScriptCommands();
commands.setGeoserver(geoserver);
String actual = commands.listSession(null);
String expected = "0 groovy" + OsUtils.LINE_SEPARATOR + "1 python" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri("/geoserver/rest/sessions"));
}
示例15: getCoverageStore
@Test
public void getCoverageStore() throws Exception {
String url = "/geoserver/rest/workspaces/nurc/coveragestores/arcGridSample.xml";
whenHttp(server).match(get(url)).then(stringContent(getResourceString("coveragestore.xml")), status(HttpStatus.OK_200));
Geoserver geoserver = new Geoserver("http://00.0.0.0:8888/geoserver", "admin", "geoserver");
CoverageStoreCommands commands = new CoverageStoreCommands();
commands.setGeoserver(geoserver);
String actual = commands.get("nurc", "arcGridSample");
String expected = "arcGridSample" + OsUtils.LINE_SEPARATOR +
" Type: ArcGrid" + OsUtils.LINE_SEPARATOR +
" URL: file:coverages/arc_sample/precip30min.asc" + OsUtils.LINE_SEPARATOR +
" Enabled: true" + OsUtils.LINE_SEPARATOR;
assertEquals(expected, actual);
verifyHttp(server).once(method(Method.GET), uri(url));
}