1 6 7 28 package javax.xml.soap; 29 30 import java.io.InputStream ; 31 import java.io.Reader ; 32 import java.util.Iterator ; 33 34 import javax.activation.DataHandler ; 35 36 120 121 public abstract class AttachmentPart { 122 132 public abstract int getSize() throws SOAPException ; 133 134 138 public abstract void clearContent(); 139 140 174 public abstract Object getContent() throws SOAPException ; 175 176 198 public abstract InputStream getRawContent() throws SOAPException ; 199 200 215 public abstract byte[] getRawContentBytes() throws SOAPException ; 216 217 232 public abstract InputStream getBase64Content() throws SOAPException ; 233 234 255 public abstract void setContent(Object object, String contentType); 256 257 274 public abstract void setRawContent(InputStream content, String contentType) throws SOAPException ; 275 276 292 public abstract void setRawContentBytes( 293 byte[] content, int offset, int len, String contentType) 294 throws SOAPException ; 295 296 297 316 public abstract void setBase64Content( 317 InputStream content, String contentType) throws SOAPException ; 318 319 320 330 public abstract DataHandler getDataHandler() 331 throws SOAPException ; 332 333 346 public abstract void setDataHandler(DataHandler dataHandler); 347 348 349 357 public String getContentId() { 358 String [] values = getMimeHeader("Content-ID"); 359 if (values != null && values.length > 0) 360 return values[0]; 361 return null; 362 } 363 364 371 public String getContentLocation() { 372 String [] values = getMimeHeader("Content-Location"); 373 if (values != null && values.length > 0) 374 return values[0]; 375 return null; 376 } 377 378 385 public String getContentType() { 386 String [] values = getMimeHeader("Content-Type"); 387 if (values != null && values.length > 0) 388 return values[0]; 389 return null; 390 } 391 392 402 public void setContentId(String contentId) 403 { 404 setMimeHeader("Content-ID", contentId); 405 } 406 407 408 417 public void setContentLocation(String contentLocation) 418 { 419 setMimeHeader("Content-Location", contentLocation); 420 } 421 422 431 public void setContentType(String contentType) 432 { 433 setMimeHeader("Content-Type", contentType); 434 } 435 436 442 public abstract void removeMimeHeader(String header); 443 444 447 public abstract void removeAllMimeHeaders(); 448 449 450 459 public abstract String [] getMimeHeader(String name); 460 461 462 477 public abstract void setMimeHeader(String name, String value); 478 479 480 494 public abstract void addMimeHeader(String name, String value); 495 496 503 public abstract Iterator getAllMimeHeaders(); 504 505 514 public abstract Iterator getMatchingMimeHeaders(String [] names); 515 516 527 public abstract Iterator getNonMatchingMimeHeaders(String [] names); 528 } 529 | Popular Tags |