}
/**
- * Extract the wiki name from the current filename, replaces '/' with ':' characters, but doesn't replace '_' characters
+ * Extract the wiki name from the current filename, but doesn't replace '_' characters
*
* @param currentFile
* @return
*/
- public static String getFileWikiName(IFile currentFile) {
- return getFileWikiName(currentFile, false);
+ public static String getURLWikiName(IFile currentFile) {
+ return getURLWikiName(currentFile, false);
}
/**
- * Extract the wiki name from the current filename, replaces '/' with ':' characters, and '_' with ' ' characters if
+ * Extract the wiki name from the current filename, replaces '_' with ' ' characters if
* <code>replaceUnderscore==true</code>
*
* @param currentFile
* @param replaceUnderscore
* @return
*/
- public static String getFileWikiName(IFile currentFile, boolean replaceUnderscore) {
+ public static String getURLWikiName(IFile currentFile, boolean replaceUnderscore) {
String filePath = currentFile.getLocation().toString();
String basePath = getWikiTextsPath(currentFile);
StringBuffer result = new StringBuffer();
for (int i = basePath.length() + 1; i < lastIndex; i++) {
ch = filePath.charAt(i);
switch (ch) {
- case '/':
- result.append(':');
- break;
+// case '/':
+// result.append(':');
+// break;
default:
if (ch == '_' && replaceUnderscore) {
result.append(' ');
- } else {
+ } else {
result.append(ch);
}
}
}
/**
- * Extract the wiki name from the current filename, replaces '/' with ':' characters, and replaces all '_' with ' ' characters
+ * Extract the wiki name from the current filename, replaces all '_' with ' ' characters
*
* @param currentFile
* @return
*/
public static String getReadableWikiName(IFile currentFile) {
- return getFileWikiName(currentFile, true);
+ return getURLWikiName(currentFile, true);
}
public static String getWikiTitle(IFile currentFile) {