You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by mi...@apache.org on 2013/06/05 05:51:18 UTC
svn commit: r1489696 -
/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
Author: minoru
Date: Wed Jun 5 03:51:17 2013
New Revision: 1489696
URL: http://svn.apache.org/r1489696
Log:
Output file path includes uri.getUserInfo().
Need to remove username and password from output file path.
Modified:
manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
Modified: manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java?rev=1489696&r1=1489695&r2=1489696&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java (original)
+++ manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java Wed Jun 5 03:51:17 2013
@@ -500,37 +500,20 @@ public class FileOutputConnector extends
path.append(uri.getScheme());
}
- if (uri.getAuthority() != null) {
+ if (uri.getHost() != null) {
if (!path.toString().endsWith("/")) {
path.append("/");
}
- try {
- path.append(URLEncoder.encode(uri.getAuthority(), "UTF-8"));
- } catch(UnsupportedEncodingException e) {
- path.append(uri.getAuthority());
- }
- } else {
- if (uri.getSchemeSpecificPart() != null) {
- for (String name : uri.getSchemeSpecificPart().split("/")) {
- if (name.length() > 0) {
- path.append("/");
- try {
- path.append(URLEncoder.encode(name, "UTF-8"));
- } catch(UnsupportedEncodingException e) {
- path.append(name);
- }
- }
- }
-
- if (path.toString().endsWith("/")) {
- path.append(".content");
+ path.append(uri.getHost());
+ if (uri.getPort() != -1) {
+ if (System.getProperty("os.name").toLowerCase().contains("windows")) {
+ path.append("+");
+ } else {
+ path.append(":");
}
-
- return path.toString();
+ path.append(uri.getPort());
}
- }
-
- if (uri.getPath() != null) {
+ if (uri.getPath() != null) {
if (uri.getPath().length() == 0) {
path.append("/");
} else if (uri.getPath().equals("/")) {
@@ -548,11 +531,24 @@ public class FileOutputConnector extends
}
}
}
+ } else {
+ if (uri.getSchemeSpecificPart() != null) {
+ for (String name : uri.getSchemeSpecificPart().split("/")) {
+ if (name.length() > 0) {
+ path.append("/");
+ try {
+ path.append(URLEncoder.encode(name, "UTF-8"));
+ } catch(UnsupportedEncodingException e) {
+ path.append(name);
+ }
+ }
+ }
+ }
+ }
if (path.toString().endsWith("/")) {
path.append(".content");
}
-
return path.toString();
}
}