public static void main(String[] args) throws IOException { System.out.println(Version.of(Version.class).getVersion()); } }
public CellVersion(Version version) { this(version.getVersion(), version.getBuild()); }
public static Version of(Object object) { return of(object.getClass()); }
/** * Constructs client and connects it to the remote server. * * @param host remote server host * @param port remote server port */ public GridFTPClient(String host, int port) throws IOException, ServerException { gSession = new GridFTPSession(); session = gSession; expectedHostName = host; controlChannel = new FTPControlChannel(host, port); controlChannel.open(); gLocalServer = new GridFTPServerFacade(controlChannel); localServer = gLocalServer; gLocalServer.authorize(); this.useAllo = true; setUsageInformation("dCache", VERSION.getVersion()); }
public static Version of(Class<?> clazz) { Optional<String> buildTime = Optional.empty(); Optional<String> version = Optional.empty(); Optional<String> buildNumber = Optional.empty(); Optional<String> branch = Optional.empty(); ProtectionDomain pd = clazz.getProtectionDomain(); CodeSource cs = pd.getCodeSource(); URL u = cs.getLocation(); try (InputStream is = u.openStream()) { JarInputStream jis = new JarInputStream(is); Manifest m = jis.getManifest(); if (m != null) { Attributes as = m.getMainAttributes(); buildTime = Optional.ofNullable(as.getValue("Build-Time")); version = Optional.ofNullable(as.getValue("Implementation-Version")); buildNumber = Optional.ofNullable(as.getValue("Implementation-Build")); branch = Optional.ofNullable(as.getValue("Implementation-Branch")); } } catch (IOException ignored) { } return new Version(buildTime, version, buildNumber, branch); }
.setArgs(childArgs) .build(); _version = new CellVersion(Version.of(_loginCellFactory));
public LocationMgrTunnel(String cellName, StreamEngine engine, Args args) { super(cellName, "System", args); _nucleus = getNucleus(); _socket = engine.getSocket(); _rawOut = new BufferedOutputStream(engine.getOutputStream()); _rawIn = new BufferedInputStream(engine.getInputStream()); CellDomainRole role = args.hasOption("role") ? CellDomainRole.valueOf( args.getOption("role").toUpperCase()) : CellDomainRole.SATELLITE; _localDomainInfo = new CellDomainInfo(_nucleus.getCellDomainName(), Version.of(LocationMgrTunnel.class).getVersion(), role); }
LoggerFactory.getLogger(GridFTPClient.class); private static final Version VERSION = Version.of(GridFTPClient.class);