Search in sources :

Example 1 with FessSystemException

use of org.codelibs.fess.exception.FessSystemException in project fess by codelibs.

the class SpnegoAuthenticator method init.

@PostConstruct
public void init() {
    if ("spnego".equals(ComponentUtil.getFessConfig().getSsoType())) {
        try {
            // set some System properties
            final SpnegoFilterConfig config = SpnegoFilterConfig.getInstance(new SpengoConfig());
            // pre-authenticate
            authenticator = new org.codelibs.spnego.SpnegoAuthenticator(config);
        } catch (final Exception e) {
            throw new FessSystemException("Failed to initialize SPNEGO.", e);
        }
    }
}
Also used : SpnegoFilterConfig(org.codelibs.spnego.SpnegoFilterConfig) FessSystemException(org.codelibs.fess.exception.FessSystemException) SsoLoginException(org.codelibs.fess.exception.SsoLoginException) FessSystemException(org.codelibs.fess.exception.FessSystemException) PostConstruct(javax.annotation.PostConstruct)

Example 2 with FessSystemException

use of org.codelibs.fess.exception.FessSystemException in project fess by codelibs.

the class AdminDesignAction method edit.

// -----------------------------------------------------
// Edit
// ------
@Execute
@Secured({ ROLE })
public HtmlResponse edit(final EditForm form) {
    final String jspType = "view";
    final File jspFile = getJspFile(form.fileName, jspType);
    try {
        form.content = new String(FileUtil.readBytes(jspFile), Constants.UTF_8);
    } catch (final UnsupportedEncodingException e) {
        throw new FessSystemException("Invalid encoding", e);
    }
    saveToken();
    return asEditHtml(form);
}
Also used : UnsupportedEncodingException(java.io.UnsupportedEncodingException) File(java.io.File) FessSystemException(org.codelibs.fess.exception.FessSystemException) Execute(org.lastaflute.web.Execute) Secured(org.codelibs.fess.annotation.Secured)

Example 3 with FessSystemException

use of org.codelibs.fess.exception.FessSystemException in project fess by codelibs.

the class FessStandardTransformer method getExtractor.

@Override
protected Extractor getExtractor(final ResponseData responseData) {
    final ExtractorFactory extractorFactory = ComponentUtil.getExtractorFactory();
    if (extractorFactory == null) {
        throw new FessSystemException("Could not find extractorFactory.");
    }
    Extractor extractor = extractorFactory.getExtractor(responseData.getMimeType());
    if (extractor == null) {
        extractor = ComponentUtil.getComponent("tikaExtractor");
        if (extractor == null) {
            throw new FessSystemException("Could not find tikaExtractor.");
        }
    }
    if (logger.isDebugEnabled()) {
        logger.debug("url={}, extractor={}", responseData.getUrl(), extractor);
    }
    return extractor;
}
Also used : ExtractorFactory(org.codelibs.fess.crawler.extractor.ExtractorFactory) Extractor(org.codelibs.fess.crawler.extractor.Extractor) FessSystemException(org.codelibs.fess.exception.FessSystemException)

Example 4 with FessSystemException

use of org.codelibs.fess.exception.FessSystemException in project fess by codelibs.

the class FessFileTransformer method getExtractor.

@Override
protected Extractor getExtractor(final ResponseData responseData) {
    final ExtractorFactory extractorFactory = ComponentUtil.getExtractorFactory();
    if (extractorFactory == null) {
        throw new FessSystemException("Could not find extractorFactory.");
    }
    final Extractor extractor = extractorFactory.getExtractor(responseData.getMimeType());
    if (logger.isDebugEnabled()) {
        logger.debug("url={}, extractor={}", responseData.getUrl(), extractor);
    }
    return extractor;
}
Also used : ExtractorFactory(org.codelibs.fess.crawler.extractor.ExtractorFactory) Extractor(org.codelibs.fess.crawler.extractor.Extractor) FessSystemException(org.codelibs.fess.exception.FessSystemException)

Example 5 with FessSystemException

use of org.codelibs.fess.exception.FessSystemException in project fess by codelibs.

the class SystemHelper method parseProjectProperties.

protected void parseProjectProperties() {
    final Path propPath = ResourceUtil.getProjectPropertiesFile();
    try (final InputStream in = Files.newInputStream(propPath)) {
        final Properties prop = new Properties();
        prop.load(in);
        version = prop.getProperty("fess.version", "0.0.0");
        final String[] values = version.split("\\.");
        majorVersion = Integer.parseInt(values[0]);
        minorVersion = Integer.parseInt(values[1]);
        productVersion = majorVersion + "." + minorVersion;
        System.setProperty("fess.version", version);
        System.setProperty("fess.product.version", productVersion);
    } catch (final Exception e) {
        throw new FessSystemException("Failed to parse project.properties.", e);
    }
}
Also used : Path(java.nio.file.Path) InputStream(java.io.InputStream) Properties(java.util.Properties) IORuntimeException(org.codelibs.core.exception.IORuntimeException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) FessSystemException(org.codelibs.fess.exception.FessSystemException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) ExecutionException(java.util.concurrent.ExecutionException) FessSystemException(org.codelibs.fess.exception.FessSystemException)

Aggregations

FessSystemException (org.codelibs.fess.exception.FessSystemException)23 UnsupportedEncodingException (java.io.UnsupportedEncodingException)7 IOException (java.io.IOException)6 File (java.io.File)5 ArrayList (java.util.ArrayList)5 Execute (org.lastaflute.web.Execute)5 BufferedReader (java.io.BufferedReader)4 InputStream (java.io.InputStream)4 InputStreamReader (java.io.InputStreamReader)4 Reader (java.io.Reader)4 Map (java.util.Map)4 PostConstruct (javax.annotation.PostConstruct)4 HashMap (java.util.HashMap)3 Secured (org.codelibs.fess.annotation.Secured)3 BufferedInputStream (java.io.BufferedInputStream)2 Path (java.nio.file.Path)2 Date (java.util.Date)2 List (java.util.List)2 ExecutionException (java.util.concurrent.ExecutionException)2 Consumer (java.util.function.Consumer)2