All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.fd.fp.common.FileAttachmentWrapper Maven / Gradle / Ivy

/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
*  Copyright 2015 Adobe Systems Incorporated
*  All Rights Reserved.
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

package com.adobe.fd.fp.common;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

public class FileAttachmentWrapper {
    private String fileName;
    private String contentType;
    private byte[] bytes;
  
    public FileAttachmentWrapper(String fileName, String contentType, byte[] bytes) {
        this.fileName = fileName;
        this.contentType = contentType;
        if(bytes == null) {
           this.bytes = null;
        } else {
           this.bytes = bytes.clone();
        }
    }
   
    public String getFileName() {
        return this.fileName;
    }
   
    public String getContentType() {
        return this.contentType;
    }
   
    public InputStream getInputStream() {
        return new ByteArrayInputStream(this.bytes);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy