This code really wants to do a simple character substitution,
which has an elegant solution. This means we do not end up
compiling the replacement pattern and use a very efficient method.
Change-Id: I8430ecf9216ae49c3fcc58c24c0315f6510204fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
throw new IllegalArgumentException("Package Name cannot be NULL!");
}
- final String[] subDirNames = packageName.split("\\.");
- final StringBuilder dirPathBuilder = new StringBuilder();
- dirPathBuilder.append(subDirNames[0]);
- for (int i = 1; i < subDirNames.length; ++i) {
- dirPathBuilder.append(File.separator);
- dirPathBuilder.append(subDirNames[i]);
- }
- return new File(parentDirectory, dirPathBuilder.toString());
+ return new File(parentDirectory, packageName.replace('.', File.separatorChar));
}
}