[
https://issues.apache.org/jira/browse/CONNECTORS-710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13682057#comment-13682057
]
Karl Wright commented on CONNECTORS-710:
----------------------------------------
Here's what I was thinking. I also moved some common stuff around for
clarity...
{code}
Index:
connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
===================================================================
---
connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
(revision 1492578)
+++
connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
(working copy)
@@ -263,7 +263,11 @@
// Get the file's modified date.
long lastModified = file.lastModified();
StringBuilder sb = new StringBuilder();
- sb.append(new
Long(lastModified).toString()).append(":").append(new
Long(fileLength).toString()).append(":").append(filePathToUri);
+ if (filePathToUri)
+ sb.append("+");
+ else
+ sb.append("-");
+ sb.append(new
Long(lastModified).toString()).append(":").append(new
Long(fileLength).toString());
rval[i] = sb.toString();
}
else
@@ -305,7 +311,6 @@
long startTime = System.currentTimeMillis();
String errorCode = "OK";
String errorDesc = null;
String entityReference = documentIdentifier;
try
{
@@ -366,20 +371,13 @@
* get filepathtouri value
*/
boolean filePathToUri = false;
- j = 0;
- while (j < spec.getChildCount()) {
- SpecificationNode sn = spec.getChild(j++);
- if (sn.getType().equals("filepathtouri")) {
- filePathToUri = Boolean.valueOf(sn.getValue());
- }
- }
+ if (version.length() > 0 && version.startsWith("+"))
+ filePathToUri = true;
long startTime = System.currentTimeMillis();
String errorCode = "OK";
String errorDesc = null;
Long fileLength = null;
String entityDescription = documentIdentifier;
try
{
{code}
The full patch I will attach.
> FileConnector should have option of outputting a full http url, not just a
> file:/ url
> -------------------------------------------------------------------------------------
>
> Key: CONNECTORS-710
> URL: https://issues.apache.org/jira/browse/CONNECTORS-710
> Project: ManifoldCF
> Issue Type: Improvement
> Components: File system connector
> Affects Versions: ManifoldCF 1.3
> Reporter: Minoru Osuka
> Assignee: Minoru Osuka
> Fix For: ManifoldCF 1.3
>
> Attachments: CONNECTORS-710.version.patch, Screen Shot 2013-06-11 at
> 5.46.55 PM.png
>
>
> I would like to enhance that FileConnector be able to convert from file path
> to URI.
> FileOutputConnector will output the file path like Wget.
> $OUTPUT_PATH/http/localhost:8345/mcf-crawler-ui/showjobstatus.jsp
> I would like to enhance that FileConector be able to put documentIdentifere
> like WebConnector.
> Current FileConnector can output id following,
> {code:xml}
> <str
> name="id">file:/Users/minoru/tmp/out/http/localhost:8345/mcf-crawler-ui/showjobstatus.jsp</str>
> {code}
> Enhanced FileConnector can output id following,
> {code:xml}
> <str
> name="id">file:/Users/minoru/tmp/out/http/localhost:8345/mcf-crawler-ui/showjobstatus.jsp</str>
> {code}
> or
> {code:xml}<str
> name="id">http://localhost:8345/mcf-crawler-ui/showjobstatus.jsp</str></str>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira