|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| XJavadocFile.java | 50% | 36.4% | 33.3% | 36.4% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* Copyright (c) 2001-2003 The XDoclet team
|
|
| 3 |
* All rights reserved.
|
|
| 4 |
*/
|
|
| 5 |
package xjavadoc.filesystem;
|
|
| 6 |
|
|
| 7 |
import java.io.File;
|
|
| 8 |
import java.io.FileInputStream;
|
|
| 9 |
import java.io.InputStreamReader;
|
|
| 10 |
import java.io.Reader;
|
|
| 11 |
import java.io.IOException;
|
|
| 12 |
import java.io.UnsupportedEncodingException;
|
|
| 13 |
import java.io.Writer;
|
|
| 14 |
import java.io.FileReader;
|
|
| 15 |
import java.io.FileWriter;
|
|
| 16 |
import java.io.OutputStream;
|
|
| 17 |
import java.io.FileOutputStream;
|
|
| 18 |
import java.io.FileNotFoundException;
|
|
| 19 |
|
|
| 20 |
/**
|
|
| 21 |
* @created September 25, 2002
|
|
| 22 |
*/
|
|
| 23 |
public class XJavadocFile implements AbstractFile |
|
| 24 |
{
|
|
| 25 |
private File file;
|
|
| 26 |
|
|
| 27 | 1804 |
public XJavadocFile( File file )
|
| 28 |
{
|
|
| 29 | 1804 |
this.file = file;
|
| 30 |
} |
|
| 31 |
|
|
| 32 | 0 |
public Reader getReader() throws IOException |
| 33 |
{
|
|
| 34 | 0 |
return new FileReader( file ); |
| 35 |
} |
|
| 36 |
|
|
| 37 | 684 |
public Reader getReader(String enc) throws UnsupportedEncodingException, FileNotFoundException |
| 38 |
{
|
|
| 39 | 684 |
if (enc!=null) |
| 40 |
{
|
|
| 41 | 0 |
return new InputStreamReader(new FileInputStream(file),enc); |
| 42 |
} |
|
| 43 |
else
|
|
| 44 |
{
|
|
| 45 | 684 |
return new InputStreamReader(new FileInputStream(file)); |
| 46 |
} |
|
| 47 |
|
|
| 48 |
} |
|
| 49 |
|
|
| 50 | 0 |
public Writer getWriter() throws IOException |
| 51 |
{
|
|
| 52 | 0 |
return new FileWriter( file ); |
| 53 |
} |
|
| 54 |
|
|
| 55 | 0 |
public boolean isWriteable() |
| 56 |
{
|
|
| 57 | 0 |
return file.canWrite();
|
| 58 |
} |
|
| 59 |
|
|
| 60 | 0 |
public OutputStream getOutputStream() throws FileNotFoundException |
| 61 |
{
|
|
| 62 | 0 |
return new FileOutputStream( file ); |
| 63 |
} |
|
| 64 |
|
|
| 65 | 0 |
public String getPath()
|
| 66 |
{
|
|
| 67 | 0 |
return file.getAbsolutePath();
|
| 68 |
} |
|
| 69 |
|
|
| 70 | 1124 |
public long lastModified() |
| 71 |
{
|
|
| 72 | 1124 |
return file.lastModified();
|
| 73 |
} |
|
| 74 |
|
|
| 75 | 0 |
public String toString()
|
| 76 |
{
|
|
| 77 | 0 |
return "File " + file.getAbsolutePath(); |
| 78 |
} |
|
| 79 |
} |
|
| 80 |
|
|
||||||||||