com.hpe.caf.worker.emailsegregation.ClassEnquirerImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of util-email-content-segregation Show documentation
Show all versions of util-email-content-segregation Show documentation
A Java module that calls to the Mailgun/Talon library via the Jep interpreter to perform email content segregation
The newest version!
/*
* Copyright 2017-2018 Micro Focus or one of its affiliates.
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.hpe.caf.worker.emailsegregation;
import jep.ClassEnquirer;
/**
* Implementation of the ClassEnquirer interface for Jep.
* Any Packages beginning "io" or "re" will be passed to this
* implementation to decide whether it is a Java or Python
* package.
*
* This will need to be expanded if packages other than Dropwizard are
* added to the classpath.
*/
public class ClassEnquirerImpl implements ClassEnquirer {
/**
* Checks if the package is for Java.
* @param name The name of the package to import.
* @return True if a Java Package.
*/
@Override
public boolean isJavaPackage(String name) {
return name.contains("dropwizard");
}
@Override
public String[] getClassNames(String pkgName) {
return new String[0];
}
@Override
public String[] getSubPackages(String pkgName) {
return new String[0];
}
}