com.atlassian.jira.rest.v2.avatar
Class FileUtil

java.lang.Object
  extended by com.atlassian.jira.rest.v2.avatar.FileUtil

@Component
public class FileUtil
extends Object

Created by dszuksztul on 20/03/14.


Nested Class Summary
static class FileUtil.StreamSizeMismatchException
           
 
Constructor Summary
FileUtil()
           
 
Method Summary
 File createTempFile(InputStream stream, String filenamePrefix)
          Creates temp file frm given stream
 File createTempFileFromBoundedStream(InputStream stream, long size, String filenamePrefix)
          Creates temp file frm given stream with expecteation that this stream will have given siae.
 File createTemporaryFile(String prefix, String suffix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

createTempFileFromBoundedStream

public File createTempFileFromBoundedStream(InputStream stream,
                                            long size,
                                            String filenamePrefix)
                                     throws LimitedOutputStream.TooBigIOException,
                                            FileUtil.StreamSizeMismatchException,
                                            IOException
Creates temp file frm given stream with expecteation that this stream will have given siae.

Parameters:
stream - stream to copy data from
size - expected number of bytes from stream
filenamePrefix -
Returns:
temp file created from stream contents
Throws:
IOException - some io
LimitedOutputStream.TooBigIOException - when size of stream is bigger than expected
FileUtil.StreamSizeMismatchException - when size of stream is smaller than expected

createTempFile

public File createTempFile(InputStream stream,
                           String filenamePrefix)
                    throws IOException
Creates temp file frm given stream

Parameters:
stream - stream to copy data from
filenamePrefix -
Returns:
temp file created from stream contents
Throws:
IOException - some io

createTemporaryFile

public File createTemporaryFile(String prefix,
                                String suffix)
                         throws IOException
Throws:
IOException


Copyright © 2002-2014 Atlassian. All Rights Reserved.