@@ -0,0 +1,2301 @@
+/*%0A *  Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A *%0A *  WSO2 Inc. licenses this file to you under the Apache License,%0A *  Version 2.0 (the %22License%22); you may not use this file except%0A *  in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage org.wso2.carbon.apimgt.impl.filter;%0A%0A%0Aimport javax.servlet.Filter;%0Aimport javax.servlet.FilterConfig;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.ServletRequest;%0Aimport javax.servlet.ServletResponse;%0Aimport javax.servlet.FilterChain;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.FileInputStream;%0A%0A%0Apublic class URLMappingFilter implements Filter %7B%0A%0A    private FilterConfig filterConfig = null;%0A    private String appPath = %22./repository/deployment/server/jaggeryapps%22;%0A    private String replaceValue= %22public%22;%0A    private String customeValue = %22override%22;%0A%0A    public void init(FilterConfig filterConfig) throws ServletException %7B%0A        this.filterConfig = filterConfig;%0A    %7D%0A%0A    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)%0A            throws IOException, ServletException %7B%0A        HttpServletRequest request1 = (HttpServletRequest) request;%0A        File file = new File( appPath +%0A                request1.getRequestURI().replace(replaceValue, customeValue));%0A        boolean exists = file.exists();%0A%0A        if (exists) %7B%0A            //init array with file length%0A            byte%5B%5D bytesArray = new byte%5B(int) file.length()%5D;%0A%0A            FileInputStream fis = new FileInputStream(file);%0A            fis.read(bytesArray); //read file into bytes%5B%5D%0A            fis.close();%0A            response.getOutputStream().write(bytesArray);%0A        %7D else %7B%0A            chain.doFilter(request, response);%0A        %7D%0A    %7D%0A%0A    public void destroy() %7B%0A        filterConfig = null;%0A    %7D%0A%7D%0A

Add url mapping filter