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);
}
}
}
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);
}
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;
}
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;
}
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);
}
}
Aggregations