int resourceSegmentCount = fullPath.segmentCount();
int sourceFolderSegmentCount = this.sourceLocation.sourceFolder.getFullPath().segmentCount();
int charCount = (resourceSegmentCount - sourceFolderSegmentCount - 1);
resourceSegmentCount--; // deal with the last segment separately
for (int i = sourceFolderSegmentCount; i < resourceSegmentCount; i++)
charCount += fullPath.segment(i).length();
String lastSegment = fullPath.segment(resourceSegmentCount);
int extensionIndex = Util.indexOfJavaLikeExtension(lastSegment);
charCount += extensionIndex;
char[] result = new char[charCount];