Package org.apache.portals.applications.webcontent.proxy.impl

Examples of org.apache.portals.applications.webcontent.proxy.impl.DefaultURICleanerImpl.clean()


        String wrongUriWithSpace = "http://SERVER/0/F8C57293124EDBF9C125783200376835/$FILE/EXXO-ADDM-2011-000020-01 (p2).doc";
       
        DefaultURICleanerImpl uriCleaner = new DefaultURICleanerImpl();
        uriCleaner.setSearchList(new String [] { " " });
        uriCleaner.setReplacementList(new String [] { "%20" });
        String cleanedUri = uriCleaner.clean(wrongUriWithSpace);
        assertEquals("http://SERVER/0/F8C57293124EDBF9C125783200376835/$FILE/EXXO-ADDM-2011-000020-01%20(p2).doc", cleanedUri);

        wrongUriWithSpace = "http://SERVER/0/F8C57293124EDBF9C125783200376835/$FILE/EXXO-ADDM-2011-000020-01 (p2)^^^.doc";
        uriCleaner.setSearchList(new String [] { " ", "^" });
        uriCleaner.setReplacementList(new String [] { "%20", "%5E" });
View Full Code Here


        assertEquals("http://SERVER/0/F8C57293124EDBF9C125783200376835/$FILE/EXXO-ADDM-2011-000020-01%20(p2).doc", cleanedUri);

        wrongUriWithSpace = "http://SERVER/0/F8C57293124EDBF9C125783200376835/$FILE/EXXO-ADDM-2011-000020-01 (p2)^^^.doc";
        uriCleaner.setSearchList(new String [] { " ", "^" });
        uriCleaner.setReplacementList(new String [] { "%20", "%5E" });
        cleanedUri = uriCleaner.clean(wrongUriWithSpace);
        assertEquals("http://SERVER/0/F8C57293124EDBF9C125783200376835/$FILE/EXXO-ADDM-2011-000020-01%20(p2)%5E%5E%5E.doc", cleanedUri);
    }  
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.