1 19 package org.netbeans.lib.cvsclient.command; 20 21 import java.io.*; 22 23 28 public class PipedFileInformation extends FileInfoContainer { 29 private File file; 30 31 private String repositoryRevision; 32 33 private String repositoryFileName; 34 35 private File tempFile; 36 37 private OutputStream tmpStream; 38 39 public PipedFileInformation(File tempFile) { 40 this.tempFile = tempFile; 41 try { 43 tmpStream = new BufferedOutputStream(new FileOutputStream(tempFile)); 44 } 45 catch (IOException ex) { 46 } 48 } 49 50 53 public File getFile() { 54 return file; 55 } 56 57 60 protected void setFile(File file) { 61 this.file = file; 62 } 63 64 67 public String getRepositoryRevision() { 68 return repositoryRevision; 69 } 70 71 74 protected void setRepositoryRevision(String repositoryRevision) { 75 this.repositoryRevision = repositoryRevision; 76 } 77 78 81 public String getRepositoryFileName() { 82 return repositoryFileName; 83 } 84 85 88 protected void setRepositoryFileName(String repositoryFileName) { 89 this.repositoryFileName = repositoryFileName; 90 } 91 92 95 protected void addToTempFile(byte[] bytes) throws IOException { 96 if (tmpStream != null) { 97 tmpStream.write(bytes); 98 } 99 } 100 103 public void addToTempFile(byte[] bytes, int len) throws IOException { 104 if (tmpStream != null) { 105 tmpStream.write(bytes, 0, len); 106 } 107 } 108 109 protected void closeTempFile() throws IOException { 110 if (tmpStream != null) { 111 tmpStream.flush(); 112 tmpStream.close(); 113 } 114 } 115 116 public File getTempFile() { 117 return tempFile; 118 } 119 120 } 121 | Popular Tags |