/** * A helper method for {@linkplain #getGeoToolsJarInfo} which scans the classpath looking for * GeoTools jars matching the current version. * * @return a list of jar names */ private static List<String> getGeoToolsJars() { final Pattern pattern = Pattern.compile(".*\\/" + getVersion() + "\\/(gt-.*jar$)"); final List<String> jarNames = new ArrayList<String>(); String pathSep = System.getProperty("path.separator"); String classpath = System.getProperty("java.class.path"); StringTokenizer st = new StringTokenizer(classpath, pathSep); while (st.hasMoreTokens()) { String path = st.nextToken(); Matcher matcher = pattern.matcher(path); if (matcher.find()) { jarNames.add(matcher.group(1)); } } Collections.sort(jarNames); return jarNames; }
public String newRequestHandle(WFSOperationType operation) { StringBuilder handle = new StringBuilder("GeoTools ") .append(GeoTools.getVersion()) .append("(") .append(GeoTools.getBuildRevision()) .append(") WFS ") .append(getVersion()) .append(" DataStore @"); try { handle.append(InetAddress.getLocalHost().getHostName()); } catch (Exception ignore) { handle.append("<uknown host>"); } AtomicLong reqHandleSeq = requestHandleSequences.get(operation); handle.append('#').append(reqHandleSeq.incrementAndGet()); return handle.toString(); }
/** * Returns summary information about the GeoTools version and the host environment. * * @return information as a String */ public static String getEnvironmentInfo() { final String newline = String.format("%n"); final StringBuilder sb = new StringBuilder(); sb.append("GeoTools version ").append(getVersion().toString()); if (sb.toString().endsWith("SNAPSHOT")) { sb.append(" (built from r").append(getBuildRevision().toString()).append(")"); } sb.append(newline).append("Java version: "); sb.append(System.getProperty("java.version")); sb.append(newline).append("Operating system: "); sb.append(System.getProperty("os.name")) .append(' ') .append(System.getProperty("os.version")); return sb.toString(); }
/** Sets the metadata information. */ private void setInfo() { Map<String, String> info = new HashMap<String, String>(); info.put("name", "ArcSDE Raster"); info.put("description", "ArcSDE Raster Format"); info.put("vendor", "Geotools "); info.put("docURL", ""); info.put("version", GeoTools.getVersion().toString()); mInfo = info; readParameters = new ParameterGroup( new DefaultParameterDescriptorGroup( mInfo, new GeneralParameterDescriptor[] { READ_GRIDGEOMETRY2D, OVERVIEW_POLICY })); }
/** * Reports the GeoTools {@linkplain #getVersion version} number to the {@linkplain System#out * standard output stream}. * * @param args Command line arguments. */ public static void main(String[] args) { final Arguments arguments = new Arguments(args); args = arguments.getRemainingArguments(0); arguments.out.print("GeoTools version "); arguments.out.println(getVersion()); final Hints hints = getDefaultHints(); if (hints != null && !hints.isEmpty()) { arguments.out.println(hints); } } }
|| name.startsWith("net.opengis")) { String generated = "Manifest-Version: 1.0\n" + "Project-Version: " + getVersion() + "\n";
return GeoTools.getVersion();