Package fr.norsys.mapper.console.exception

Examples of fr.norsys.mapper.console.exception.ConnectionException


  private void add(Connection connection, Collection connections) throws ConnectionException {
    Connection c = null;
    try {
      c = (Connection) BeanUtils.cloneBean(connection);
    } catch (Exception e) {
      throw new ConnectionException("Unable to clone bean "+c);
    }
    c.setId(UIDGenerator.generateId());
    connections.add(c);
    try {
      fileService.createNewFile(c.getName()+propFileExt,connectionsDirPath);
    } catch (FileException e) {
      throw new ConnectionException(e.toString());
    }
  }
View Full Code Here


      if (connection.getId().equals(c.getId())) {
        if (!connection.getName().equals(c.getName())) {
          try {
            fileService.changeFileName(c.getName()+propFileExt, connection.getName()+propFileExt, connectionsDirPath);
          } catch (FileException e) {
            throw new ConnectionException(e.toString());
          }
        }
        fr.norsys.mapper.console.utils.BeanUtils.copyFilledProperties(
            c, connection);
        connection=c;
View Full Code Here

      if (c.getId().equals(id)) {
        connections.remove(c);
        try {
          fileService.deleteFile(c.getName()+".properties",connectionsDirPath);
        } catch (FileException e) {
          throw new ConnectionException(e.toString());
        }
        break;
      }
    }
  }
View Full Code Here

  public Collection getConnectionsFromFileSystem()  throws ConnectionException{
    List connectionsNames;
    try {
      connectionsNames = fileService.getFilesName(connectionsDirPath,propFileExt);
    } catch (FileException e) {
      throw new ConnectionException(e.toString());
    }
    Collection connections = new TreeSet(new ConnectionNameComparator());
    Connection c = null;
    for(Iterator i=connectionsNames.iterator();i.hasNext();){
      c = new Connection((String)i.next());
View Full Code Here

TOP

Related Classes of fr.norsys.mapper.console.exception.ConnectionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.