@Component public class

FileUtil

extends Object
java.lang.Object
   ↳ com.atlassian.jira.rest.v2.avatar.FileUtil

Class Overview

Created by dszuksztul on 20/03/14.

Summary

Nested Classes
class FileUtil.StreamSizeMismatchException  
Public Constructors
FileUtil()
Public Methods
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)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FileUtil ()

Public Methods

public File createTempFile (InputStream stream, String filenamePrefix)

Creates temp file frm given stream

Parameters
stream stream to copy data from
Returns
  • temp file created from stream contents
Throws
IOException some io

public File createTempFileFromBoundedStream (InputStream stream, long size, String filenamePrefix)

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
Returns
  • temp file created from stream contents
Throws
IOException some io
when size of stream is bigger than expected
FileUtil.StreamSizeMismatchException when size of stream is smaller than expected
LimitedOutputStream.TooBigIOException

public File createTemporaryFile (String prefix, String suffix)

Throws
IOException