public void AfterPropertiesSet()
{
Assert.NotNull(Host, "Host attribute cannot be null");
Assert.NotNull(Username, "Username attribute cannot be null");
Assert.NotNull(Password, "Password attribute cannot be null");
Assert.NotNull(LocalDirectory, "LocalDirectory attribute cannot be null");
Assert.NotNull(RemoteDirectory, "RemoteDirectory attribute cannot be null");
Assert.NotNull(FileNamePattern, "FileNamePattern attribute cannot be null");
//Handle default values
if (Port == null)
{
//Set default value
Port = "21";
}
if (!Directory.Exists(LocalDirectory))
{
if (AutoCreateLocalDirectory)
{
if (Logger.IsDebugEnabled)
{
Logger.Debug(string.Format("The {0} directory doesn't exist; Will create.", LocalDirectory));
}
Directory.CreateDirectory(LocalDirectory);
}
else
{
throw new DirectoryNotFoundException(LocalDirectory);
}
}
}
}