1893 |
if (!packageDir.exists() && !packageDir.mkdirs()) { |
if (!packageDir.exists() && !packageDir.mkdirs()) { |
1894 |
throw new IOException("Couldn't create directory " + packageDir); |
throw new IOException("Couldn't create directory " + packageDir); |
1895 |
} |
} |
|
File sourcePackageDir = null; |
|
1896 |
try { |
try { |
1897 |
sourcePackageDir = getPackageSourceDir(packageDoc); |
List packageSourceDirs = getPackageSourceDirs(packageDoc); |
1898 |
copyDocFiles(sourcePackageDir, packageDir); |
Iterator pdIt = packageSourceDirs.iterator(); |
1899 |
|
while (pdIt.hasNext()) { |
1900 |
|
File sourcePackageDir = (File)pdIt.next(); |
1901 |
|
copyDocFiles(sourcePackageDir, packageDir); |
1902 |
|
} |
1903 |
} |
} |
1904 |
catch (IOException ignore) { |
catch (IOException ignore) { |
1905 |
} |
} |
1923 |
printClassUsagePage(packageDir, pathToRoot, classDocs[j]); |
printClassUsagePage(packageDir, pathToRoot, classDocs[j]); |
1924 |
} |
} |
1925 |
if (optionLinkSource.getValue() && null == classDoc.containingClass()) { |
if (optionLinkSource.getValue() && null == classDoc.containingClass()) { |
1926 |
if (null != sourcePackageDir) { |
try { |
1927 |
|
File sourceFile = getSourceFile(classDoc); |
1928 |
|
|
1929 |
Java2xhtml java2xhtml = new Java2xhtml(); |
Java2xhtml java2xhtml = new Java2xhtml(); |
1930 |
Properties properties = new Properties(); |
Properties properties = new Properties(); |
1931 |
properties.setProperty("isCodeSnippet", "true"); |
properties.setProperty("isCodeSnippet", "true"); |
1933 |
java2xhtml.setProperties(properties); |
java2xhtml.setProperties(properties); |
1934 |
|
|
1935 |
StringWriter sourceBuffer = new StringWriter(); |
StringWriter sourceBuffer = new StringWriter(); |
|
File sourceFile = new File(sourcePackageDir, |
|
|
classDoc.name() + ".java"); |
|
1936 |
FileReader sourceReader = new FileReader(sourceFile); |
FileReader sourceReader = new FileReader(sourceFile); |
1937 |
IOToolkit.copyStream(sourceReader, sourceBuffer); |
IOToolkit.copyStream(sourceReader, sourceBuffer); |
1938 |
sourceReader.close(); |
sourceReader.close(); |
1944 |
targetWriter.write(result); |
targetWriter.write(result); |
1945 |
targetWriter.close(); |
targetWriter.close(); |
1946 |
} |
} |
1947 |
else { |
catch (IOException e) { |
1948 |
printWarning("Cannot locate source file for class " + classDoc.qualifiedTypeName()); |
printWarning("Cannot locate source file for class " + classDoc.qualifiedTypeName()); |
1949 |
} |
} |
1950 |
} |
} |