protected GenericFileName(final String scheme, final String hostName, final int port, final int defaultPort, final String userName, final String password, final String path, final FileType type) { super(scheme, path, type); this.hostName = hostName; this.defaultPort = defaultPort; this.password = password; this.userName = userName; if (port > 0) { this.port = port; } else { this.port = getDefaultPort(); } }
protected GenericFileName(final String scheme, final String hostName, final int port, final int defaultPort, final String userName, final String password, final String path, final FileType type) { super(scheme, path, type); this.hostName = hostName; this.defaultPort = defaultPort; this.password = password; this.userName = userName; if (port > 0) { this.port = port; } else { this.port = getDefaultPort(); } }
protected GenericFileName(final String scheme, final String hostName, final int port, final int defaultPort, final String userName, final String password, final String path, final FileType type) { super(scheme, path, type); this.hostName = hostName; this.defaultPort = defaultPort; this.password = password; this.userName = userName; if (port > 0) { this.port = port; } else { this.port = getDefaultPort(); } }
protected GenericFileName(final String scheme, final String hostName, final int port, final int defaultPort, final String path, final FileType type ) { super(scheme, path, type); this.hostName = hostName; this.defaultPort = defaultPort; if (port > 0) { this.port = port; } else { this.port = getDefaultPort(); } }
/** * Builds the root URI for this file name. */ @Override protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) { buffer.append(getScheme()); buffer.append("://"); buffer.append(hostName); if (port != getDefaultPort()) { buffer.append(':'); buffer.append(port); } } }
/** * Builds the root URI for this file name. */ @Override protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) { buffer.append(getScheme()); buffer.append("://"); appendCredentials(buffer, addPassword); buffer.append(hostName); if (port != getDefaultPort()) { buffer.append(':'); buffer.append(port); } }
/** * Builds the root URI for this file name. */ @Override protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) { buffer.append(getScheme()); buffer.append("://"); appendCredentials(buffer, addPassword); buffer.append(hostName); if (port != getDefaultPort()) { buffer.append(':'); buffer.append(port); } }
/** * Builds the root URI for this file name. */ @Override protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) { buffer.append(getScheme()); buffer.append("://"); appendCredentials(buffer, addPassword); buffer.append(hostName); if (port != getDefaultPort()) { buffer.append(':'); buffer.append(port); } }
assertEquals("hostname", name.getHostName()); assertEquals(21, name.getPort()); assertEquals(name.getDefaultPort(), name.getPort()); assertEquals("/file", name.getPath()); assertEquals("ftp://hostname/", name.getRootURI());
assertEquals("hostname", name.getHostName()); assertEquals(21, name.getPort()); assertEquals(name.getDefaultPort(), name.getPort()); assertEquals("/file", name.getPath()); assertEquals("ftp://hostname/", name.getRootURI());
assertEquals("hostname", name.getHostName()); assertEquals(21, name.getPort()); assertEquals(name.getDefaultPort(), name.getPort()); assertEquals("/file", name.getPath()); assertEquals("ftp://hostname/", name.getRootURI());