11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.net; 27 28 /** 29 * Helper class to map URL "abbreviations" to real URLs. 30 * The default implementation supports the following mappings: 31 * ftp.mumble.bar/... => ftp://ftp.mumble.bar/... 32 * gopher.mumble.bar/... => gopher://gopher.mumble.bar/... 33 * other.name.dom/... => http://other.name.dom/... 34 * /foo/... => file:/foo/... 35 * 36 * Full URLs (those including a protocol name) are passed through unchanged. 37 * 38 * Subclassers can override or extend this behavior to support different 39 * or additional canonicalization policies. 40 * 41 * @author Steve Byrne 42 */ 43 44 public class URLCanonicalizer { 45 /** 46 * Creates the default canonicalizer instance. 47 */ 48 public URLCanonicalizer() { } 49 50 /** 51 * Given a possibly abbreviated URL (missing a protocol name, typically), 52 * this method's job is to transform that URL into a canonical form, 53 * by including a protocol name and additional syntax, if necessary. 54 * | 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.net; 27 28 /** 29 * Helper class to map URL "abbreviations" to real URLs. 30 * The default implementation supports the following mappings: 31 * <pre>{@code 32 * ftp.mumble.bar/... => ftp://ftp.mumble.bar/... 33 * gopher.mumble.bar/... => gopher://gopher.mumble.bar/... 34 * other.name.dom/... => http://other.name.dom/... 35 * /foo/... => file:/foo/... 36 * }</pre> 37 * 38 * Full URLs (those including a protocol name) are passed through unchanged. 39 * 40 * Subclassers can override or extend this behavior to support different 41 * or additional canonicalization policies. 42 * 43 * @author Steve Byrne 44 */ 45 46 public class URLCanonicalizer { 47 /** 48 * Creates the default canonicalizer instance. 49 */ 50 public URLCanonicalizer() { } 51 52 /** 53 * Given a possibly abbreviated URL (missing a protocol name, typically), 54 * this method's job is to transform that URL into a canonical form, 55 * by including a protocol name and additional syntax, if necessary. 56 * |