1 /* 2 * Copyright 2007-2008 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.gwe.utils.security; 18 19 import org.gwe.utils.IOUtils; 20 21 /** 22 * @author Marco Ruiz 23 * @since Sep 17, 2008 24 */ 25 public enum ProtocolScheme { 26 27 FILE("file"), 28 SFTP("sftp"), 29 HTTP("http"), 30 LOCAL("local"), 31 SSH("ssh"), 32 RMI("rmi"); 33 34 private String scheme; 35 36 ProtocolScheme(String scheme) { 37 this.scheme = scheme; 38 } 39 40 public String toURIStr(String... suffixes) { 41 return scheme + ThinURI.SCHEME_SEPARATOR + IOUtils.concatenatePaths(suffixes); 42 } 43 44 public String toString() { 45 return scheme; 46 } 47 }