/*
 * Copyright (c) 2014, Cloudera, Inc. and Intel Corp. All Rights Reserved.
 *
 * Cloudera, Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"). You may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for
 * the specific language governing permissions and limitations under the
 * License.
 */

package com.cloudera.oryx.lambda.serving;

import java.util.HashSet;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.servlet.ServletContext;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.Path;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;

import com.google.common.base.Preconditions;
import org.reflections.Reflections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The single JAX-RS app for the serving-layer.
 */
@ApplicationPath("")
public final class OryxApplication extends Application {

  private static final Logger log = LoggerFactory.getLogger(OryxApplication.class);

  @Context
  private ServletContext servletContext;
  private String packages;

  @PostConstruct
  public void init() {
    packages = servletContext.getInitParameter(OryxApplication.class.getName() + ".packages");
    Preconditions.checkNotNull(packages);
  }

  /**
   * @return  user endpoint implementations from the package named in init param
   *  {@code com.cloudera.oryx.lambda.serving.OryxApplication.packages}.
   */
  @Override
  public Set<Class<?>> getClasses() {
    log.info("Creating JAX-RS from endpoints in package(s) {}", packages);
    Reflections reflections = new Reflections(packages);
    Set<Class<?>> classes = reflections.getTypesAnnotatedWith(Path.class);
    Set<Class<?>> providerClasses = reflections.getTypesAnnotatedWith(Provider.class);
    classes.addAll(providerClasses);
    log.info("Found JAX-RS resources: {}", classes);
    return classes;
  }

  private Set<Class<?>> getFilterClasses() {
    Set<Class<?>> filterClassesSet = new HashSet<>(3);
    filterClassesSet.add(GZipEncoder.class);
  }

}

@@ -626,34 +626,8 @@
 g;%0A%0A
-import java.util.HashSet;%0A
 impo
@@ -2135,156 +2135,6 @@
  %7D%0A%0A
-  private Set%3CClass%3C?%3E%3E getFilterClasses() %7B%0A    Set%3CClass%3C?%3E%3E filterClassesSet = new HashSet%3C%3E(3);%0A    filterClassesSet.add(GZipEncoder.class);%0A  %7D%0A%0A
 %7D%0A

Fix issues from last local commit