use of com.axway.ats.rbv.model.MatchableAlreadyOpenException in project ats-framework by Axway.
the class ImapFolder method open.
/**
*
* @see com.axway.ats.rbv.storage.Matchable#open()
*/
public void open() throws RbvStorageException {
//first check if the folder is already open
if (isOpen) {
throw new MatchableAlreadyOpenException(getDescription() + " is already open");
}
try {
isInitialPass = true;
// create and connect to the user's imap folder
if (!store.isConnected()) {
store.connect(serverHost, userName, password);
log.debug("Connected to store '" + serverHost + "' with user '" + userName + "' and password '" + password + "'");
}
if (folder == null || !folder.isOpen()) {
folder = store.getFolder(folderName);
folder.open(Folder.READ_WRITE);
}
allMetaDataList.clear();
newMetaDataList.clear();
isOpen = true;
log.info("Opened " + getDescription());
} catch (MessagingException me) {
throw new RbvStorageException("Could not open " + getDescription(), me);
}
}
use of com.axway.ats.rbv.model.MatchableAlreadyOpenException in project ats-framework by Axway.
the class Test_MatchableAlreadyOpenException method constructors.
@Test
public void constructors() {
MatchableAlreadyOpenException exception;
exception = new MatchableAlreadyOpenException("test");
assertEquals("test", exception.getMessage());
assertNull(exception.getCause());
Exception helperException = new Exception();
exception = new MatchableAlreadyOpenException("test", helperException);
assertEquals("test", exception.getMessage());
assertEquals(helperException, exception.getCause());
exception = new MatchableAlreadyOpenException(helperException);
assertEquals("java.lang.Exception", exception.getMessage());
assertEquals(helperException, exception.getCause());
}
use of com.axway.ats.rbv.model.MatchableAlreadyOpenException in project ats-framework by Axway.
the class FileSystemFolder method open.
public void open() throws RbvStorageException {
//first check if the folder is already open
if (isOpen) {
throw new MatchableAlreadyOpenException("File system folder is already open");
}
try {
//get the name of the OS
this.osType = this.systemOperations.getOperatingSystemType();
// provide path valid for the target host
this.path = IoUtils.normalizeDirPath(path, this.osType);
} catch (Exception e) {
throw new RbvStorageException("Could not open " + getDescription(), e);
}
isOpen = true;
}
Aggregations