summaryrefslogtreecommitdiffstats
path: root/catalog-fe
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-fe')
-rw-r--r--catalog-fe/pom.xml59
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java40
-rw-r--r--catalog-fe/src/main/webapp/WEB-INF/web.xml11
3 files changed, 51 insertions, 59 deletions
diff --git a/catalog-fe/pom.xml b/catalog-fe/pom.xml
index 4883978261..155b14c486 100644
--- a/catalog-fe/pom.xml
+++ b/catalog-fe/pom.xml
@@ -446,64 +446,5 @@
<finalName>${project.artifactId}-${project.version}</finalName>
</build>
</profile>
-
- <profile>
- <id>build</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
-
- <build>
- <finalName>${project.artifactId}-${full.release.version}</finalName>
-
- <plugins>
- <!-- ================================================== -->
- <!-- Get the next versions from the properties file. -->
- <!-- ================================================== -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>properties-maven-plugin</artifactId>
- <version>1.0-alpha-2</version>
-
- <executions>
- <execution>
- <inherited>false</inherited>
- <phase>initialize</phase>
- <goals>
- <goal>read-project-properties</goal>
- </goals>
- <configuration>
- <files>
- <file>${project.parent.build.directory}/FullReleaseVersion.properties</file>
- </files>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>Fortify</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.fortify.ps.maven.plugin</groupId>
- <artifactId>sca-maven-plugin</artifactId>
- <version>4.30</version>
- <configuration>
- <source>1.8</source>
- <buildId>${project.parent.artifactId}</buildId>
- <toplevelArtifactId>${project.parent.artifactId}</toplevelArtifactId>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
</project>
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java
new file mode 100644
index 0000000000..884e688503
--- /dev/null
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.fe;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+public class GzipFilter implements Filter {
+
+ @Override
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
+ throws IOException,
+ ServletException {
+
+
+ final HttpServletResponse httpResponse = (HttpServletResponse) response;
+
+
+ httpResponse.setHeader("Content-Encoding", "gzip");
+ httpResponse.setHeader("Content-Type", "application/javascript");
+ chain.doFilter(request, response);
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void destroy() {
+ // TODO Auto-generated method stub
+
+ }
+} \ No newline at end of file
diff --git a/catalog-fe/src/main/webapp/WEB-INF/web.xml b/catalog-fe/src/main/webapp/WEB-INF/web.xml
index 9c81055652..725c041c51 100644
--- a/catalog-fe/src/main/webapp/WEB-INF/web.xml
+++ b/catalog-fe/src/main/webapp/WEB-INF/web.xml
@@ -105,6 +105,17 @@
</filter-mapping>
+
+ <filter>
+ <filter-name>gzipFilter</filter-name>
+ <filter-class>org.openecomp.sdc.fe.GzipFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>gzipFilter</filter-name>
+ <url-pattern>*.jsgz</url-pattern>
+ </filter-mapping>
+
<listener>
<listener-class>org.openecomp.sdc.fe.listen.FEAppContextListener</listener-class>
</listener>