public ConnectionFileName createChildName( String name, FileType type ) {
    String childAbsPath = getConnectionFileNameUtils().ensureTrailingSeparator( getPath() ) + name;
    return new ConnectionFileName( connection, childAbsPath, type );
  }
@Test
  public void testCreateChildNameRespectsSpecifiedFileType() {
    ConnectionFileName parentFileName = new ConnectionFileName( "connection", "/", FileType.FOLDER );

    ConnectionFileName childFileName = parentFileName.createChildName( "child", FileType.FILE );

    assertEquals( FileType.FILE, childFileName.getType() );

    // ---

    childFileName = parentFileName.createChildName( "child", FileType.FOLDER );

    assertEquals( FileType.FOLDER, childFileName.getType() );
  }