Skip to content

[MJAVADOC-746] Remove Netware code #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 16 additions & 69 deletions src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
Expand Down Expand Up @@ -1095,12 +1094,6 @@ private static class PathTokenizer {
*/
private String lookahead = null;

/**
* A boolean that determines if we are running on Novell NetWare, which exhibits slightly different path name
* characteristics (multi-character volume / drive names)
*/
private boolean onNetWare = Os.isFamily("netware");

/**
* Flag to indicate whether or not we are running on a platform with a DOS style filesystem
*/
Expand All @@ -1112,15 +1105,7 @@ private static class PathTokenizer {
* @param path The path to tokenize. Must not be <code>null</code>.
*/
PathTokenizer(String path) {
if (onNetWare) {
// For NetWare, use the boolean=true mode, so we can use delimiter
// information to make a better decision later.
tokenizer = new StringTokenizer(path, ":;", true);
} else {
// on Windows and Unix, we can ignore delimiters and still have
// enough information to tokenize correctly.
tokenizer = new StringTokenizer(path, ":;", false);
}
tokenizer = new StringTokenizer(path, ":;", false);
dosStyleFilesystem = File.pathSeparatorChar == ';';
}

Expand Down Expand Up @@ -1150,59 +1135,21 @@ public String nextToken() throws NoSuchElementException {
token = tokenizer.nextToken().trim();
}

if (!onNetWare) {
if (token.length() == 1
&& Character.isLetter(token.charAt(0))
&& dosStyleFilesystem
&& tokenizer.hasMoreTokens()) {
// we are on a dos style system so this path could be a drive
// spec. We look at the next token
String nextToken = tokenizer.nextToken().trim();
if (nextToken.startsWith("\\") || nextToken.startsWith("/")) {
// we know we are on a DOS style platform and the next path
// starts with a slash or backslash, so we know this is a
// drive spec
token += ":" + nextToken;
} else {
// store the token just read for next time
lookahead = nextToken;
}
}
} else {
// we are on NetWare, tokenizing is handled a little differently,
// due to the fact that NetWare has multiple-character volume names.
if (token.equals(File.pathSeparator) || token.equals(":")) {
// ignore ";" and get the next token
token = tokenizer.nextToken().trim();
}

if (tokenizer.hasMoreTokens()) {
// this path could be a drive spec, so look at the next token
String nextToken = tokenizer.nextToken().trim();

// make sure we aren't going to get the path separator next
if (!nextToken.equals(File.pathSeparator)) {
if (nextToken.equals(":")) {
if (!token.startsWith("/")
&& !token.startsWith("\\")
&& !token.startsWith(".")
&& !token.startsWith("..")) {
// it indeed is a drive spec, get the next bit
String oneMore = tokenizer.nextToken().trim();
if (!oneMore.equals(File.pathSeparator)) {
token += ":" + oneMore;
} else {
token += ":";
lookahead = oneMore;
}
}
// implicit else: ignore the ':' since we have either a
// UNIX or a relative path
} else {
// store the token just read for next time
lookahead = nextToken;
}
}
if (token.length() == 1
&& Character.isLetter(token.charAt(0))
&& dosStyleFilesystem
&& tokenizer.hasMoreTokens()) {
// we are on a dos style system so this path could be a drive
// spec. We look at the next token
String nextToken = tokenizer.nextToken().trim();
if (nextToken.startsWith("\\") || nextToken.startsWith("/")) {
// we know we are on a DOS style platform and the next path
// starts with a slash or backslash, so we know this is a
// drive spec
token += ":" + nextToken;
} else {
// store the token just read for next time
lookahead = nextToken;
}
}
return token;
Expand Down