This commit is contained in:
Shinsuke Sugaya 2013-11-11 22:11:42 +09:00
parent 4133ab139a
commit 8fdacead9b
3 changed files with 24 additions and 1 deletions

View file

@ -317,7 +317,7 @@ public class IndexAction {
}
}
if (url.startsWith("file:")) {
if (isFileSystemPath(url)) {
if (Constants.TRUE.equals(crawlerProperties.getProperty(
Constants.SEARCH_FILE_PROXY_PROPERTY, Constants.TRUE))) {
final CrawlingConfigHelper crawlingConfigHelper = SingletonS2Container
@ -370,6 +370,10 @@ public class IndexAction {
return null;
}
protected boolean isFileSystemPath(final String url) {
return url.startsWith("file:") || url.startsWith("smb:");
}
protected String doSearchInternal() {
final StringBuilder queryBuf = new StringBuilder(255);
if (StringUtil.isNotBlank(indexForm.query)) {

View file

@ -96,6 +96,9 @@ public class CrawlingConfigHelper implements Serializable {
}
public void writeContent(final Map<String, Object> doc) {
if (logger.isDebugEnabled()) {
logger.debug("writing the content of: " + doc);
}
final Object configIdObj = doc.get(configIdField);
if (configIdObj == null || configIdObj.toString().length() < 2) {
throw new FessSystemException("Invalid configId: " + configIdObj);
@ -103,6 +106,9 @@ public class CrawlingConfigHelper implements Serializable {
final String configType = configIdObj.toString().substring(0, 1);
final String idStr = configIdObj.toString().substring(1);
CrawlingConfig config = null;
if (logger.isDebugEnabled()) {
logger.debug("configType: " + configType + ", idStr: " + idStr);
}
if (Constants.WEB_CONFIG_ID_PREFIX.equals(configType)) {
final WebCrawlingConfigService webCrawlingConfigService = SingletonS2Container
.getComponent(WebCrawlingConfigService.class);
@ -151,6 +157,9 @@ public class CrawlingConfigHelper implements Serializable {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(os);
}
if (logger.isDebugEnabled()) {
logger.debug("Finished to write " + url);
}
}
protected void writeNoCache(final HttpServletResponse response,
@ -179,6 +188,11 @@ public class CrawlingConfigHelper implements Serializable {
name = URLDecoder.decode(url, charset);
}
if (logger.isDebugEnabled()) {
logger.debug("userAgentType: " + userAgentType + ", charset: "
+ charset + ", name: " + name);
}
switch (userAgentType) {
case IE:
response.setHeader(
@ -215,6 +229,9 @@ public class CrawlingConfigHelper implements Serializable {
protected void writeContentType(final HttpServletResponse response,
final ResponseData responseData) {
final String mimeType = responseData.getMimeType();
if (logger.isDebugEnabled()) {
logger.debug("mimeType: " + mimeType);
}
if (mimeType == null) {
return;
}

View file

@ -47,6 +47,8 @@
<property name="useHighlightContent">true</property>
-->
</component>
<component name="userAgentHelper" class="jp.sf.fess.helper.UserAgentHelper">
</component>
<component name="userAgentName" class="java.lang.String">
<arg>"Fess Robot/1.0"</arg>
</component>