# Class WarWatcher.WarInfo

java.lang.Object
org.apache.catalina.ha.deploy.WarWatcher.WarInfo

Enclosing class:
  `WarWatcher`

protected static class WarWatcher.WarInfo extends Object
File information on existing WAR files

## Field Summary

Fields
Modifier and Type
Field
Description
`protected long`
`lastModified`
The last time this file was modified.
`protected int`
`lastState`
The last known state of the file.
`protected final File`
`war`
The WAR file being tracked.

## Constructor Summary

Constructors
Constructor
Description
`WarInfo(File war)`
Constructs a new WarInfo.

## Method Summary

Modifier and Type
Method
Description
`int`
`check()`
Returns 1 if the file has been added/modified, 0 if the file is unchanged and -1 if the file has been removed
`boolean`
`equals(Object other)`
`boolean`
`exists()`
Returns whether the WAR file exists.
`File`
`getWar()`
Returns the WAR file.
`int`
`hashCode()`
`boolean`
`modified()`
Returns whether the WAR file has been modified since last check.
`protected void`
`setLastState(int lastState)`
Sets the last known state of the file.

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### war

protected final File war
The WAR file being tracked.

### lastModified

protected long lastModified
The last time this file was modified.

### lastState

protected int lastState
The last known state of the file.

## Constructor Details

### WarInfo

public WarInfo(File war)
Constructs a new WarInfo.

Parameters:
  `war` - The WAR file to track

## Method Details

### modified

public boolean modified()
Returns whether the WAR file has been modified since last check.

Returns:
  `true` if the file has been modified

### exists

public boolean exists()
Returns whether the WAR file exists.

Returns:
  `true` if the file exists

### check

public int check()
Returns 1 if the file has been added/modified, 0 if the file is unchanged and -1 if the file has been removed

Returns:
  int 1=file added; 0=unchanged; -1=file removed

### getWar

public File getWar()
Returns the WAR file.

Returns:
  the WAR file

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### setLastState

protected void setLastState(int lastState)
Sets the last known state of the file.

Parameters:
  `lastState` - The last state