/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Svjatoslav Commons - shared library of common functionality.
* Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
public class UrlParamEncoder {
- public static String decode(final String source) {
+ public static String decode(final String source) {
- final String result = source.replaceAll("%20", " ");
+ final String result = source.replaceAll("%20", " ");
- return result;
- }
+ return result;
+ }
- public static String encode(final String source) {
+ public static String encode(final String source) {
- final StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < source.length(); i++) {
- boolean replaced = false;
- final char character = source.charAt(i);
+ final StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < source.length(); i++) {
+ boolean replaced = false;
+ final char character = source.charAt(i);
- if (character == ' ') {
- buffer.append("%20");
- replaced = true;
- }
+ if (character == ' ') {
+ buffer.append("%20");
+ replaced = true;
+ }
- if (character == '?') {
- buffer.append("%3F");
- replaced = true;
- }
+ if (character == '?') {
+ buffer.append("%3F");
+ replaced = true;
+ }
- if (character == ',') {
- buffer.append("%2C");
- replaced = true;
- }
+ if (character == ',') {
+ buffer.append("%2C");
+ replaced = true;
+ }
- if (character == ':') {
- buffer.append("%3A");
- replaced = true;
- }
+ if (character == ':') {
+ buffer.append("%3A");
+ replaced = true;
+ }
- if (!replaced)
- buffer.append(character);
- }
+ if (!replaced)
+ buffer.append(character);
+ }
- return buffer.toString();
- }
+ return buffer.toString();
+ }
}
private DirectoryMetadata getMetadataForPath(final String requestPath)
throws ClassNotFoundException, IOException {
- final String urlString = globalPrefix + Utils.urlEncode(requestPath) +"/.thumbnails/metadata_6.dat";
+ final String urlString = globalPrefix + Utils.urlEncode(requestPath) + "/.thumbnails/metadata_6.dat";
for (int i = 0; true; i++)
try {
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.