Package com.mockobjects.io

# Class MockFile

java.lang.Object
com.mockobjects.MockObject
com.mockobjects.io.MockFile

All Implemented Interfaces:
  `File`, `Verifiable`

public class MockFile extends MockObject implements File

## Constructor Summary

Constructors
Constructor
Description
`MockFile()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canRead()`
`boolean`
`canWrite()`
`int`
`compareTo(File pathname)`
`int`
`compareTo(Object o)`
`boolean`
`createNewFile()`
`File`
`createTempFile(String prefix, String suffix)`
`File`
`createTempFile(String prefix, String suffix, File directory)`
`boolean`
`delete()`
`void`
`deleteOnExit()`
`boolean`
`exists()`
`File`
`getAbsoluteFile()`
`String`
`getAbsolutePath()`
`File`
`getCanonicalFile()`
`String`
`getCanonicalPath()`
`String`
`getName()`
`String`
`getParent()`
`File`
`getParentFile()`
`String`
`getPath()`
`File`
`getRealFile()`
`boolean`
`isAbsolute()`
`boolean`
`isDirectory()`
`boolean`
`isFile()`
`boolean`
`isHidden()`
`long`
`lastModified()`
`long`
`length()`
`String[]`
`list()`
`String[]`
`list(FilenameFilter filter)`
`File[]`
`listFiles()`
`File[]`
`listFiles(FileFilter filter)`
`File[]`
`listFiles(FilenameFilter aFilenameFilter)`
`File[]`
`listRoots()`
`boolean`
`mkdir()`
`boolean`
`mkdirs()`
`boolean`
`renameTo(File dest)`
`void`
`setExpectedFilenameFilter(FilenameFilter aFilenameFilter)`
`boolean`
`setLastModified(long time)`
`boolean`
`setReadOnly()`
`void`
`setupExists(boolean exists)`
`void`
`setupGetAbsolutePath(String absolutePath)`
`void`
`setupGetName(String name)`
`void`
`setupGetParent(String aParent)`
`void`
`setupGetParentFile(File parentFile)`
`void`
`setupGetPath(String aPath)`
`void`
`setupGetRealFile(File file)`
`void`
`setupListFile(File[] aFilesToReturn)`
`void`
`setupMkdirs(boolean mkdirs, int count)`
`URL`
`toURL()`

### Methods inherited from class com.mockobjects.MockObject

`notImplemented, notYetImplemented, verify`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockFile

public MockFile()

## Method Details

### setupGetName

public void setupGetName(String name)

### getName

public String getName()

Specified by:
  `getName` in interface `File`

### setupGetParent

public void setupGetParent(String aParent)

### getParent

public String getParent()

Specified by:
  `getParent` in interface `File`

### setupGetParentFile

public void setupGetParentFile(File parentFile)

### getParentFile

public File getParentFile()

Specified by:
  `getParentFile` in interface `File`

### createTempFile

public File createTempFile(String prefix, String suffix, File directory) throws IOException

Specified by:
  `createTempFile` in interface `File`
Throws:
  `IOException`

### createTempFile

public File createTempFile(String prefix, String suffix) throws IOException

Specified by:
  `createTempFile` in interface `File`
Throws:
  `IOException`

### listRoots

public File[] listRoots()

Specified by:
  `listRoots` in interface `File`

### setupGetPath

public void setupGetPath(String aPath)

### getPath

public String getPath()

Specified by:
  `getPath` in interface `File`

### isAbsolute

public boolean isAbsolute()

Specified by:
  `isAbsolute` in interface `File`

### setupGetAbsolutePath

public void setupGetAbsolutePath(String absolutePath)

### getAbsolutePath

public String getAbsolutePath()

Specified by:
  `getAbsolutePath` in interface `File`

### getAbsoluteFile

public File getAbsoluteFile()

Specified by:
  `getAbsoluteFile` in interface `File`

### getCanonicalPath

public String getCanonicalPath() throws IOException

Specified by:
  `getCanonicalPath` in interface `File`
Throws:
  `IOException`

### getCanonicalFile

public File getCanonicalFile() throws IOException

Specified by:
  `getCanonicalFile` in interface `File`
Throws:
  `IOException`

### toURL

public URL toURL() throws MalformedURLException

Specified by:
  `toURL` in interface `File`
Throws:
  `MalformedURLException`

### canRead

public boolean canRead()

Specified by:
  `canRead` in interface `File`

### canWrite

public boolean canWrite()

Specified by:
  `canWrite` in interface `File`

### setupExists

public void setupExists(boolean exists)

### exists

public boolean exists()

Specified by:
  `exists` in interface `File`

### isDirectory

public boolean isDirectory()

Specified by:
  `isDirectory` in interface `File`

### isFile

public boolean isFile()

Specified by:
  `isFile` in interface `File`

### isHidden

public boolean isHidden()

Specified by:
  `isHidden` in interface `File`

### lastModified

public long lastModified()

Specified by:
  `lastModified` in interface `File`

### length

public long length()

Specified by:
  `length` in interface `File`

### createNewFile

public boolean createNewFile() throws IOException

Specified by:
  `createNewFile` in interface `File`
Throws:
  `IOException`

### delete

public boolean delete()

Specified by:
  `delete` in interface `File`

### deleteOnExit

public void deleteOnExit()

Specified by:
  `deleteOnExit` in interface `File`

### list

public String[] list()

Specified by:
  `list` in interface `File`

### list

public String[] list(FilenameFilter filter)

Specified by:
  `list` in interface `File`

### listFiles

public File[] listFiles()

Specified by:
  `listFiles` in interface `File`

### setExpectedFilenameFilter

public void setExpectedFilenameFilter(FilenameFilter aFilenameFilter)

### setupListFile

public void setupListFile(File[] aFilesToReturn)

### listFiles

public File[] listFiles(FilenameFilter aFilenameFilter)

Specified by:
  `listFiles` in interface `File`

### listFiles

public File[] listFiles(FileFilter filter)

Specified by:
  `listFiles` in interface `File`

### mkdir

public boolean mkdir()

Specified by:
  `mkdir` in interface `File`

### setupMkdirs

public void setupMkdirs(boolean mkdirs, int count)

### mkdirs

public boolean mkdirs()

Specified by:
  `mkdirs` in interface `File`

### renameTo

public boolean renameTo(File dest)

Specified by:
  `renameTo` in interface `File`

### setLastModified

public boolean setLastModified(long time)

Specified by:
  `setLastModified` in interface `File`

### setReadOnly

public boolean setReadOnly()

Specified by:
  `setReadOnly` in interface `File`

### compareTo

public int compareTo(File pathname)

Specified by:
  `compareTo` in interface `File`

### compareTo

public int compareTo(Object o)

Specified by:
  `compareTo` in interface `File`

### setupGetRealFile

public void setupGetRealFile(File file)

### getRealFile

public File getRealFile()

Specified by:
  `getRealFile` in interface `File`