Examples of UnifiedRepositoryException


Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

  @Test
  public void testBlockoutWillFireError() throws Exception {
    JobScheduleRequest mockJobScheduleRequest = mock( JobScheduleRequest.class );

    UnifiedRepositoryException mockUnifiedRepositoryException = mock( UnifiedRepositoryException.class );

    SchedulerException mockSchedulerException = mock( SchedulerException.class );

    Response mockUnifiedRepositoryExceptionResponse = mock( Response.class );
    doReturn( mockUnifiedRepositoryExceptionResponse ).when( schedulerResource )
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

      } else if ( data instanceof NodeRepositoryFileData ) {
        fos.write( inputStreamToBytes( new ByteArrayInputStream( ( (NodeRepositoryFileData) data ).getNode().toString()
            .getBytes() ) ) );
      }
    } catch ( FileNotFoundException e ) {
      throw new UnifiedRepositoryException( "Error writing file [" + fileNameWithPath + "]", e );
    } catch ( IOException e ) {
      throw new UnifiedRepositoryException( "Error writing file [" + fileNameWithPath + "]", e );
    } finally {
      IOUtils.closeQuietly( fos );
    }

    return internalGetFile( f );
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

      File newFolder = new File( folderNameWithPath );
      newFolder.mkdir();
      final RepositoryFile repositoryFolder = internalGetFile( newFolder );
      return repositoryFolder;
    } catch ( Throwable th ) {
      throw new UnifiedRepositoryException();
    }
  }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

      } else if( NodeRepositoryFileData.class.getName().equals( dataClass.getName() ) ) {
        throw new UnsupportedOperationException( "This operation is not support by this repository" );
      }
     
    } catch ( FileNotFoundException e ) {
      throw new UnifiedRepositoryException( e );
    }
    return data;
  }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

      } else if ( data instanceof NodeRepositoryFileData ) {
        fos.write( inputStreamToBytes( new ByteArrayInputStream( ( (NodeRepositoryFileData) data ).getNode().toString()
            .getBytes() ) ) );
      }
    } catch ( FileNotFoundException e ) {
      throw new UnifiedRepositoryException( e );
    } catch ( IOException e ) {
      throw new UnifiedRepositoryException( e );
    } finally {
      IOUtils.closeQuietly( fos );
    }

    return getFile( file.getPath() );
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

          data.append( '\n' );
        }
        fos = new FileOutputStream( metadataFile );
        fos.write( data.toString().getBytes() );
      } catch ( FileNotFoundException e ) {
        throw new UnifiedRepositoryException( "Error writing file metadata [" + fileId + "]", e );
      } catch ( IOException e ) {
        throw new UnifiedRepositoryException( "Error writing file metadata [" + fileId + "]", e );
      } finally {
        IOUtils.closeQuietly( fos );
      }
    }
  }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

        data = reader.readLine();
      }
    } catch ( FileNotFoundException e ) {
      // Do nothing ... metadata empty
    } catch ( IOException e ) {
      throw new UnifiedRepositoryException( "Error reading metadata [" + fileId + "]", e );
    } finally {
      IOUtils.closeQuietly( reader );
    }
    return metadata;
  }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

    public void addChild( final FileRecord fileRecord ) {
      // make sure no name collision
      for ( FileRecord child : children ) {
        if ( child.getFile().getName().equals( fileRecord.getFile().getName() ) ) {
          throw new UnifiedRepositoryException( String.format( "file [%s] already exists", fileRecord.getFile()
              .getName() ) );
        }
      }
      children.add( fileRecord );
      fileRecord.setParent( this );
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

    }

    public FileRecord getFileById( final Serializable fileId ) {
      FileRecord r = idMap.get( fileId );
      if ( r == null ) {
        throw new UnifiedRepositoryException( String.format( "file id [%s] does not exist", fileId ) );
      }
      return r;
    }
View Full Code Here

Examples of org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException

    private Map<Serializable, List<FrozenFileRecord>> versionMap = new HashMap<Serializable, List<FrozenFileRecord>>();

    public FrozenFileRecord getLatestVersion( final Serializable fileId ) {
      List<FrozenFileRecord> history = versionMap.get( fileId );
      if ( history == null ) {
        throw new UnifiedRepositoryException( String.format( "version history for [%s] does not exist", fileId ) );
      }
      return history.get( history.size() - 1 );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.