gpt4 book ai didi

pl.edu.icm.yadda.common.YaddaException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 11:44:49 29 4
gpt4 key购买 nike

本文整理了Java中pl.edu.icm.yadda.common.YaddaException类的一些代码示例,展示了YaddaException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YaddaException类的具体详情如下:
包路径:pl.edu.icm.yadda.common.YaddaException
类名称:YaddaException

YaddaException介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yadda-common

/**
 * Utility method which returns an array containing name/value pair created from single string.
 * @param value
 * @return
 */
public static String[] parseValue(String value) throws YaddaException {
  int i = value.indexOf(SEPARATOR);
  if (i<0) {
    throw new YaddaException("Invalid stored name/value ["+value+"]");
  } else {
    String[] ret = new String[2];
    // name
    ret[0] = value.substring(0, i);
    // value
    ret[1] = value.substring(i+SEPARATOR_LENGTH);
    return ret;
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

private static synchronized ICitationParser getRegexpCitationParser() throws YaddaException{
  try {
    if(citationParser==null)
    citationParser = new RegexpReferenceParser2("pl/edu/icm/yadda/tools/content/config/referenceParser.properties");
  } catch (YaddaException e) {
    citationParser = null;
    log.error(e.toString());
    for(StackTraceElement s: e.getStackTrace())
      log.error(s.toString());
  }
  return citationParser;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

log.error("Failure during parsing of reference in RelationStatementBuilder;" +
    "Continuing work... \nError code:");
log.error(e.toString());

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

log.error("Failure during parsing of reference in RelationStatementBuilder;" +
    "Continuing work... \nError code:");
log.error(e.toString());

代码示例来源:origin: pl.edu.icm.yadda/yadda-common

protected void writeProperties() throws YaddaException {
  FileOutputStream out = null;
  try {
    out = new FileOutputStream(file); 
    properties.store(out, null);
    out.close();
    out = null;
  } catch (Exception e) {
    throw new YaddaException("Could not write properties file ["+file.getAbsolutePath()+"]", e);
  } finally {
    if (out!=null) {
      try { out.close(); } catch (Exception e) {/*do nothing*/}
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

public void setDefaultParser(){
  try {
    if(parser==null)
    parser = new RegexpReferenceParser2("pl/edu/icm/yadda/tools/content/config/referenceParser.properties");
  } catch (YaddaException e) {
    parser = null;
    log.error(e.toString());
    for(StackTraceElement s: e.getStackTrace())
      log.error(s.toString());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

log.error("Failure during parsing of reference in RelationStatementBuilder;" +
    "Continuing work... \nError code:");
log.error(e.toString());

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

public RegexpReferenceParser2(String resource) throws YaddaException {
  try {
    parser = new RegexpParser(resource, "citation");
  } catch (AnalysisException e) {
    throw new YaddaException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

public synchronized void setDefaultParser(){
  synchronized(ExtendedSurnameRelationshipStatementsBuilder.class){
    try {
      if(parser==null)
      parser = new RegexpReferenceParser2("pl/edu/icm/yadda/tools/content/config/referenceParser.properties");
    } catch (YaddaException e) {
      parser = null;
      log.error(e.toString());
      for(StackTraceElement s: e.getStackTrace())
        log.error(s.toString());
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-common

public void setPropertiesFile(File file) throws YaddaException {
  this.file = file;
  if (! file.exists()) {
    File dir = file.getParentFile();
    if (!dir.exists() && !dir.mkdirs()) {
      throw new YaddaException("Could not create directory "+dir.getAbsolutePath());
    }
  }
  readProperties();
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected T doProcess(T data, Map<String, Serializable> context, IProcessListener listener, ProcessingStats stats)
    throws Exception {
  
  //initializer.drop();
  
  String indexName = (String)context.get(Constants.PARAM_INDEX_NAME);
  if (indexName == null)
    throw new YaddaException("Index name not provided to the process");
  
  indexManagerFacade.optimize(indexName);
            
  return data;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-tools

public RegexpReferenceParser(String resource) throws YaddaException {
  try {
    parser = new RegexpParser(resource, "citation");
  } catch (AnalysisException e) {
    throw new YaddaException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-common

protected void readProperties() throws YaddaException {
  properties = new Properties();
  if (! file.exists()) {
    log.info("Properties file ["+file.getAbsolutePath()+"] does not exist");
  } else {
    InputStream in = null;
    try {
      in = new FileInputStream(file);
      properties.load(in);
      in.close();
      in = null;
    } catch (Exception e) {
      throw new YaddaException("Could not load properties file ["+file.getAbsolutePath()+"]", e);
    } finally {
      if (in!=null) {
        try { in.close(); } catch (Exception e) {/*do nothing*/}
      }    
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-services2

/**
 * Encodes a cookie into string 
 * @param cookie cookie to encode
 * @return encoded cookie
 * @throws YaddaException when encoding failed (e.g. cookie is not 
 * serializable - shouldn't happen)
 */
public static String encode(Cookie cookie) throws YaddaException {
  try {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
    oos.writeObject(cookie);
    oos.close();
    return (new BASE64Encoder().encode(os.toByteArray()));
  } catch (Exception e) {
    throw new YaddaException("Error during cookie serialization", e);
  }
  
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-services2

/**
 * Decodes a cookie from the string
 * @param stringCookie string with serialized cookie
 * @return decoded cookie
 * @throws YaddaException when serialized form is invalid
 */
public static Cookie decode(String stringCookie) throws YaddaException {
  
  try {
  
    InputStream is = new ByteArrayInputStream(new BASE64Decoder().decodeBuffer(stringCookie));
    ObjectInputStream ois = new ObjectInputStream(is);
    
    return (Cookie)ois.readObject();
  
  } catch (Exception e) {
    throw new YaddaException("Invalid cookie", e);
  }
  
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-tools

public RegexpAuthorParser(String configurationResource) throws YaddaException {
  try {
    parser = new RegexpParser(configurationResource, "author");
    surnameParser = new RegexpParser(configurationResource, "surname");
  } catch (AnalysisException e) {
    throw new YaddaException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

protected CountingIterator<CatalogObjectMeta> createPartstampIterator(
    Date from, Date to, String[] types, String[] tags, String collection) throws YaddaException {
  String[] myTags = tags;            
  if (collection != null) {
    if (myTags == null) {
      myTags = new String[] {CatalogParamConstants.TAG_COLLECTION_PREFIX+collection};
    } else {
      myTags=Utils.arrayMerge(tags,new String[] {TAG_COLLECTION_PREFIX+collection});
    }
  }            
  try {
    
    return catalogFacade.iterateByPartStamps(types, from, to, tags);
  } catch (CatalogException e) {
    log2.error("Could not initialize DateRangeSourceIterator!",e);
    throw new YaddaException("Error initializing DateRangeSourceIterator!",e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

protected CountingIterator<CatalogObjectMeta> createCatalogIterator(
    Date from, Date to, String[] tags, String collection) throws YaddaException {
  String[] myTags = tags;            
  if (collection != null) {
    if (myTags == null) {
      myTags = new String[] {CatalogParamConstants.TAG_COLLECTION_PREFIX+collection};
    } else {
      myTags=Utils.arrayMerge(tags,new String[] {TAG_COLLECTION_PREFIX+collection});
    }
  }            
  //String[] types=new String[] {TYPE_BWMETA1};
  try {
    
    return catalogFacade.iterateObjects(null, from, to, myTags, false);
  } catch (CatalogException e) {
    log2.error("Could not initialize DateRangeSourceIterator!",e);
    throw new YaddaException("Error initializing DateRangeSourceIterator!",e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

/**
 * This method is left here becouse it signature was first
 * @throws YaddaException
 */public void transfer() throws YaddaException{
  logInit();
  CountingIterator<CatalogObjectMeta> iterator = null;
  try {
    iterator = catalogFacade.iterateObjects(new String[]{}, null, null, null, false);
  } catch (CatalogException e) {
    throw new YaddaException("Cannot iterate objects", e);
  }
   log.debug("Iterator acquired");
  Iterator<String> iter=new CatalogStringIterator(iterator, this, catalogFacade);
  transfer(iter);
  
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

@Override
  public void store(MixRecord data, ProcessContext ctx)
      throws Exception {
    String normalId = data.getDotId();
    String extId = data.get10DigitId();
    
    CatalogObject normalCO = catalogFacade.getObject(new YaddaObjectID("urn:zbl:"+normalId));
    CatalogObject extCO = catalogFacade.getObject(new YaddaObjectID());
    

    
    CountingIterator<CatalogObjectMeta> iterator = null;
    try {
      iterator = catalogFacade.iterateObjects(new String[]{}, null, null, null, false);
    } catch (CatalogException e) {
      throw new YaddaException("Cannot iterate objects", e);
    }
    System.out.println("Iterator acquired");
//        Iterator<String> iter=new CatalogStringIterator(iterator, catalogFacade);
//        transfer(iter);
  }

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com