1 /*
2 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
3 * The software in this package is published under the terms of the CPAL v1.0
4 * license, a copy of which has been included with this distribution in the
5 * LICENSE.txt file.
6 */
7 package org.mule.tck.probe.file;
8
9 import org.mule.tck.probe.Probe;
10
11 import java.io.File;
12
13 /**
14 * Checks that a given file exists in the file system
15 */
16 public class FileExists implements Probe
17 {
18
19 private final File target;
20
21 public FileExists(File target)
22 {
23 this.target = target;
24 }
25
26 public boolean isSatisfied()
27 {
28 return target.exists();
29 }
30
31 public String describeFailure()
32 {
33 return String.format("File '%s' does not exists", target.getName());
34 }
35 }