@@ -0,0 +1,1226 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public%0D%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0D%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0D%0Apackage org.ocelotds;%0D%0A%0D%0Aimport java.io.BufferedReader;%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.InputStream;%0D%0Aimport java.io.InputStreamReader;%0D%0Aimport java.io.Writer;%0D%0Aimport org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author hhfrancois%0D%0A */%0D%0Apublic abstract class AbstractServiceProvider implements IServicesProvider %7B%0D%0A%09%0D%0A%09private static final Logger logger = LoggerFactory.getLogger(AbstractServiceProvider.class);%0D%0A%0D%0A%09protected abstract String getJsFilename();%0D%0A%09%0D%0A%09@Override%0D%0A%09public void streamJavascriptServices(Writer writer) %7B%0D%0A%09%09InputStream injs = this.getClass().getClassLoader().getResourceAsStream(getJsFilename());%0D%0A%09%09try (BufferedReader in = new BufferedReader(new InputStreamReader(injs, Constants.UTF_8))) %7B%0D%0A%09%09%09String inputLine;%0D%0A%09%09%09while ((inputLine = in.readLine()) != null) %7B%0D%0A%09%09%09%09writer.write(inputLine);%0D%0A%09%09%09%09writer.write(Constants.BACKSLASH_N);%0D%0A%09%09%09%7D%0D%0A%09%09%7D catch(IOException ex) %7B%0D%0A%09%09%09logger.error(%22Generation of '%22+getJsFilename()+%22' failed.%22, ex);%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%09%0D%0A%7D%0D%0A

create Abstract Class, simplfy code