Java Code Examples for org.yaml.snakeyaml.util.UriEncoder#encode()
The following examples show how to use
org.yaml.snakeyaml.util.UriEncoder#encode() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Tag.java From orion.server with Eclipse Public License 1.0 | 5 votes |
public Tag(String tag) { if (tag == null) { throw new NullPointerException("Tag must be provided."); } else if (tag.length() == 0) { throw new IllegalArgumentException("Tag must not be empty."); } else if (tag.trim().length() != tag.length()) { throw new IllegalArgumentException("Tag must not contain leading or trailing spaces."); } this.value = UriEncoder.encode(tag); }
Example 2
Source File: Tag.java From snake-yaml with Apache License 2.0 | 5 votes |
public Tag(String tag) { if (tag == null) { throw new NullPointerException("Tag must be provided."); } else if (tag.length() == 0) { throw new IllegalArgumentException("Tag must not be empty."); } else if (tag.trim().length() != tag.length()) { throw new IllegalArgumentException("Tag must not contain leading or trailing spaces."); } this.value = UriEncoder.encode(tag); this.secondary = !tag.startsWith(PREFIX); }
Example 3
Source File: FtpConnector.java From StormCV with Apache License 2.0 | 5 votes |
@Override public void moveTo(String loc) throws IOException{ try{ this.location = new URI(UriEncoder.encode(loc)); checkAndConnect(); int code = client.cwd(location.getPath()); if(code == 250) return; code = client.cwd(location.getPath().substring(0, location.getPath().lastIndexOf('/'))); }catch(Exception e){ logger.warn("Unable to move to "+location+" due to: "+e.getMessage()); throw new IOException(e); } }
Example 4
Source File: Tag.java From orion.server with Eclipse Public License 1.0 | 4 votes |
public Tag(Class<? extends Object> clazz) { if (clazz == null) { throw new NullPointerException("Class for tag must be provided."); } this.value = Tag.PREFIX + UriEncoder.encode(clazz.getName()); }
Example 5
Source File: Tag.java From snake-yaml with Apache License 2.0 | 4 votes |
public Tag(Class<? extends Object> clazz) { if (clazz == null) { throw new NullPointerException("Class for tag must be provided."); } this.value = Tag.PREFIX + UriEncoder.encode(clazz.getName()); }