Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Solved bug of output file auto sets to directory of jar instead of so…
Browse files Browse the repository at this point in the history
…urce file directory
  • Loading branch information
yeokm1 committed Dec 8, 2013
1 parent 1aa2a06 commit cbc3a91
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class MainClass{


public static final String VERSION_STRING = "\nDocs to PDF Converter Version 1.6 (8 Dec 2013)\n\nThe MIT License (MIT)\nCopyright (c) 2013-2014 Yeo Kheng Meng";
public static final String VERSION_STRING = "\nDocs to PDF Converter Version 1.7 (8 Dec 2013)\n\nThe MIT License (MIT)\nCopyright (c) 2013-2014 Yeo Kheng Meng";
public enum DOC_TYPE {
DOC,
DOCX,
Expand Down Expand Up @@ -160,16 +160,16 @@ public static class CommandLineValues {
//From http://stackoverflow.com/questions/941272/how-do-i-trim-a-file-extension-from-a-string-in-java
public static String changeExtensionToPDF(String originalPath) {

String separator = System.getProperty("file.separator");
String filename;
// String separator = System.getProperty("file.separator");
String filename = originalPath;

// Remove the path upto the filename.
int lastSeparatorIndex = originalPath.lastIndexOf(separator);
if (lastSeparatorIndex == -1) {
filename = originalPath;
} else {
filename = originalPath.substring(lastSeparatorIndex + 1);
}
// // Remove the path upto the filename.
// int lastSeparatorIndex = originalPath.lastIndexOf(separator);
// if (lastSeparatorIndex == -1) {
// filename = originalPath;
// } else {
// filename = originalPath.substring(lastSeparatorIndex + 1);
// }

// Remove the extension.
int extensionIndex = filename.lastIndexOf(".");
Expand Down

0 comments on commit cbc3a91

Please sign in to comment.