gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YContentFile类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 13:48:40 29 4
gpt4 key购买 nike

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

YContentFile介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private List<ContentInfo> getContentInfo(YContentFile file){
  Collection<String> names = convertNames(file.getNames());
  
  ContentInfo contentInfo = new ContentInfo.Builder(file.getFormat(), file.getId())
                        .locations(file.getLocations())
                        .names(names)
                        .type(file.getType())
                        .build();
  
  return Arrays.asList(contentInfo);
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

protected YContentFile getContentFile(Link link) {
    String name = link.getHref();
    name = StringUtils.removeStart(name, WileyComponentConstants.CONENT_LINK_PREFIX);
    name = StringUtils.stripStart(name, "/\\");
    YContentFile contentFile = new YContentFile(name, FileTypes.FT_FULL_TEXT, "application/pdf", null);
    contentFile.getLocations().add(name);
    return contentFile;
  }
}

代码示例来源:origin: pl.edu.icm.ceon/ceon-converters-commons

public static String getFullArchiveFileName(String elementId, YContentFile file) {
  String fileName = "archive/" + elementId + "/content/" + file.getType() + "/" +( file.getOneName(YConstants.NM_FILE_NAME).getText().replaceAll("[^-a-zA-Z0-9+&@#/%=~_|\\.]","_" ));
  return fileName;
}

代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services

@Override
public void doWithFile(YContentFile file) {
  String type = file.getType();
  String format = file.getFormat();
  if ("application/pdf".equals(format) && type==null) {
    fixed.set(true);
    file.setType(FileTypes.FT_FULL_TEXT);
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

@SuppressWarnings("rawtypes")
private String prepareVideoFormat(List<YContentEntry> contents){
  for (YContentEntry<?> yContentEntry : contents) {
    if(yContentEntry instanceof YContentFile){
      YContentFile file = (YContentFile) yContentEntry;
      if(VideoConstants.VIDEO_URL_FILE_TYPE.equals(file.getType())){
        return file.getFormat();
      }
    }
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl

private String extractId(YContentFile yFile) {
  YName fileNameCandidate = yFile.getOneName(NameTypes.NM_FILE_NAME);
  if (fileNameCandidate == null) {
    fileNameCandidate = yFile.getOneName();
  }
  
  if (fileNameCandidate == null) {
    return yFile.getId();
  } else {
    return fileNameCandidate.getText();
  }
}

代码示例来源:origin: pl.edu.icm.ceon/ceon-converters-commons

for (YTypedString signature : template.getSignatures()) {
  if (YConstants.SG_MD5.equals(signature.getType())) {
    hasMD5 = true;
      digestString.append(hexArray[0xFF & b]);
    template.addSignature(new YTypedString(YConstants.SG_MD5, digestString.toString()));
  } catch (NoSuchAlgorithmException e) {
  YContentFile description = new YContentFile();
  description.setAttributes(template.getAttributes());
  description.setDescriptions(template.getDescriptions());
  description.setFormat(template.getFormat());
  description.setId(template.getId());
  description.setLanguages(template.getLanguages());
  description.setLocations(template.getLocations());
  description.setNames(template.getNames());
  description.setSignatures(template.getSignatures());
  description.setSize(template.getSize());
  description.setType(template.getType());
      description.addLocation(YConstants.MISC_PACK_RELATIVE_CONTENT_PREFIX + fileName);

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl

if (yContentEntry.isFile()) {
    YContentFile file = (YContentFile) yContentEntry;
    String type = file.getType();
    if (ocrContentType.equals(type) && format.equalsIgnoreCase(file.getFormat())) {
      ocrContentFound = true;
      ocrContent = file;
      List<String> locations = file.getLocations();
      if (locations.size() == 1) {
        contentPartName = locations.iterator().next();
  ocrContent = new YContentFile();
  contentPartName = idGenerator.generate();
  ocrContent.addLocation(contentPartName);
  ocrContent.setType(DEFAULT_CONTENT_TYPE);
  ocrContent.setId(contentPartName);
  element.addContent(ocrContent);
  ocrContent.setFormat(format);
ocrContent.getNames().clear();
ocrContent.addName(name);

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

@SuppressWarnings("rawtypes")
private String prepareVideoId(List<YContentEntry> contents){
  for (YContentEntry<?> yContentEntry : contents) {
    if(yContentEntry instanceof YContentFile){
      YContentFile file = (YContentFile) yContentEntry;
      if(VideoConstants.VIDEO_URL_FILE_TYPE.equals(file.getType())){
        return file.getLocations().get(0);
      }
    }
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

String fAddress = null;
for (String loc : file.getLocations()) {
  boolean visible = true, remote = true;
  String address = null;
  id = Long.parseLong(file.getId());
} catch (NumberFormatException ex) {
  id = 0;
String resolvedType = resolveFileType(file.getFormat());  //temporary solution while DL won't support audio/video
if (!"audio".equals(resolvedType) && !"video".equals(resolvedType)) {
  resolvedType = file.getType();
if (YConstants.CONTENT_MULTI_TYPE.equals(parent) || file.getDefaultName() == null) {
  descr = pdescr = mimeTypeDictionary.getName(file.getFormat(),
    LocaleContextHolder.getLocale());
} else {
  descr = detailsFilter.filter(
      YRTHelper.toXmlFragment(file.getDefaultName().getRichText()),
      InputType.RICH_TEXT, filteringContext);
  pdescr = detailsFilter.filter(file.getDefaultName().getText(),
      InputType.PLAIN_TEXT, filteringContext);
String mimeIcon = detailsFilter.filter(mimeIcon(file.getFormat()), InputType.IDENTIFIER, filteringContext);

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

private List<ContentFileData> findChapterPages(List<YContentEntry> chapterEntries, Locale locale, String mainLevel) {
  List<ContentFileData> result = new ArrayList<ContentFileData>();
  for (YContentEntry<?> content : chapterEntries) {
    if (content instanceof YContentFile) {
      YContentFile file = (YContentFile) content;
      if (yModelPropertyExtractor.isFileAccepted(file, mainLevel)) {
        result.add(new ContentFileData(file.getId(), YModelUtils.getDefaultName(file), fetchName(file.getFormat(), locale), yModelPropertyExtractor.prepareLocation(file.getLocations())));
      }
    } else if (content instanceof YContentDirectory) {
      YContentDirectory dir = (YContentDirectory) content;
      if (ContentTypes.CONTENT_MULTI_TYPE.equals(dir.getType())) {
        result.addAll(findChapterPages(dir.getEntries(), locale, mainLevel));
      }
    }
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

if (content instanceof YContentFile) {
  YContentFile file = (YContentFile) content;
  final String fileName = file.getOneName().getText();
  final String location = file.getLocations().get(0);
  result.addContent(new ResourceData.ResourceFileData(file.getId(), fileName, location, file.getType()));

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

private String findThumbnailLocation(AbstractElementInfo<?> element) {
  final List<YContentFile> contentFiles = findAllThumbnailLocations(element);
  for (YContentFile contentFile : contentFiles) {
    if (contentFile.getLocations().isEmpty()) {
      continue;
    }
    return contentFile.getLocations().get(0);
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl

@Override
  public void doWithFile(YContentFile yfile) {
    if (contentId.equals(yfile.getId())) {
      List<String> locations = yfile.getLocations();
      if (locations.size() > 0) {
        location = locations.iterator().next();
      }
    }
  }
};

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

if (file != null) {
  final String mimeType;
  if(StringUtils.isNotBlank(file.getFormat())){
    mimeType = file.getFormat();
  } else {
    String location = file.getLocations().get(0);
    int lastDot = location.lastIndexOf(".");
    if(lastDot != -1){
  binaryAttachment.addTagByKey(TAG_NAME_CONTENT_NAME, file.getLocations().get(0));
} else {
  binaryAttachment.addTagByKey(TAG_NAME_CONTENT_NAME, resource.getDescription());

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

@Override
public boolean accept(YContentEntry<?> contentEntry) {
  if (contentEntry instanceof YContentDirectory) {
    return true;
  }
  YContentFile file = (YContentFile) contentEntry;
  boolean result = FileTypes.FT_PLAIN_TEXT.equals(file.getType());
  hasFiles = hasFiles || result;
  return result;
}

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

private void prepareCover(YElement element, String location, String mimeType, String fileId) {
  List<String> locations = new ArrayList<String>();
  locations.add(fileId);
  locations.add(location);
  YContentFile newCover = new YContentFile(fileId, FileTypes.FT_COVER, mimeType, locations);
  element.getContents().add(newCover);
}

代码示例来源:origin: pl.edu.icm.coansys/coansys-io-input

private void handleContent(DocumentDTO docDTO, @SuppressWarnings("rawtypes") YContentEntry content,
    ZipArchive currentZipArchive, long contentSizeLimit) {
  if (content.isFile()) {
    YContentFile yFile = (YContentFile) content;
    if (BWMetaConstants.mimePdfListExtension.contains(yFile.getFormat())) {
      fetchMediaFromZip(docDTO, yFile, currentZipArchive, ProtoConstants.mediaTypePdf, contentSizeLimit);
    } else if (BWMetaConstants.mimeTxtListExtension.contains(yFile.getFormat())) {
      fetchMediaFromZip(docDTO, yFile, currentZipArchive, ProtoConstants.mediaTypeTxt, contentSizeLimit);
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

YContentFile buildYContentFile() {
  YContentFile yContentFile = new YContentFile(String.valueOf(id), FileTypes.FT_FULL_TEXT,
      format, Lists.newArrayList(location));
  YName yName = new YName(name);
  yName.setType(NameTypes.NM_FILE_NAME);
  yContentFile.addName(yName);
  return yContentFile;
}

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

public void convertContentLocations(YContentEntry<?> entry) {
  if (entry instanceof YContentDirectory) {
    YContentDirectory dir = (YContentDirectory) entry;
    for (YContentEntry<?> e : dir.getEntries()) {
      convertContentLocations(e);
    }
    return;
  }
  YContentFile file = (YContentFile) entry;
  List<String> newLocations = new ArrayList<String>();
  for (String location : file.getLocations()) {
    newLocations.add(location.replaceAll("^" + YConstants.MISC_PACK_RELATIVE_CONTENT_PREFIX + "archive/",
        YConstants.MISC_LOCAL_CONTENT_ADDRESS_PREFIX));
  }
  file.setLocations(newLocations);
}

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