gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YContentFile.getFormat()方法的使用及代码示例

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

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

YContentFile.getFormat介绍

暂无

代码示例

代码示例来源: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)) {
    exist.set(true);
  }
}

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

private boolean isFileAcceptable(YContentFile yfile) {
  
  String type = yfile.getType();
  if (StringUtils.isBlank(type) || ACCEPTED_FILE_TYPES.contains(type)) {
    String format = yfile.getFormat();
    if (format != null) {
      format = format.toLowerCase();
      return ACCEPTED_FILE_FORMATS.contains(format);
    }
  }
  return false;
}

代码示例来源: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.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.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-business-services-api

@Override
public boolean isFileAccepted(YContentFile content, String mainLevel) {
  // XXX fallback fix
  if (YaddaIdConstants.ID_LEVEL_JOURNAL_ARTICLE.equals(mainLevel) && StringUtils.isBlank(content.getType())) {
    return true;
  }
  if (acceptedFileTypes.contains(content.getType()) && !SKIPPABLE_FILE_FORMATS.contains(content.getFormat())) {
    return true;
  }
  return false;
}

代码示例来源: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 = ACCEPTED_FILE_TYPES.contains(file.getType()) && MediaType.PDF.toString().equals(file.getFormat());
  hasFiles = hasFiles || result;
  return result;
}

代码示例来源: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) && StringUtils.isBlank(type)) {
//                if ("application/pdf".equals(format) && "content".equals(type)) {
          fixed.set(true);
          file.setType(FileTypes.FT_FULL_TEXT);
        }
      }

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

protected void fillFormats(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //        format element
  for (YContentEntry<?> yContentEntry : yElement.getContents()) {
    if (yContentEntry.isFile()) {
      if (!ret.containsKey(E_FORMAT)) {
        ret.put(E_FORMAT, new ArrayList<StringWithAttributes>());
      }
      ret.get(E_FORMAT).add(new StringWithAttributes(((YContentFile) yContentEntry).getFormat()));
    }
  }
}

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

@SuppressWarnings("rawtypes")
private Map<String, YContentFile> scanForFulltextFiles(Collection<YContentEntry> contentEntries, Set<String> formats) {
  Map<String, YContentFile> result = new HashMap<String, YContentFile>();
  for (YContentEntry contentEntry : contentEntries) {
    if (contentEntry instanceof YContentFile) {
      YContentFile contentFile = (YContentFile) contentEntry;
      if (StringUtils.equals(contentFile.getType(), "full-text") && formats.contains(contentFile.getFormat())) {
        result.put(contentFile.getFormat(), contentFile);
      }
    } else if (contentEntry instanceof YContentDirectory) {
      YContentDirectory contentDirectory = (YContentDirectory) contentEntry;
      Map<String, YContentFile> subResult = scanForFulltextFiles(contentDirectory.getEntries(), formats);
      subResult.putAll(result);
      result = subResult;
    }
  }
  return result;
}

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

protected void fillFormats(HtmlMetaHeaders metadata, YElement yElement) {
  for (YContentEntry<?> yContentEntry : yElement.getContents()) {
    if (yContentEntry.isFile()) {
      YContentFile yContentFile = (YContentFile) yContentEntry;
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_FORMAT, yContentFile.getFormat());
    }
  }
}

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

private FileType createFileType(String elementId, YContentFile yfile) {
  FileType fileType = new FileType();
  
  fileType.setID(extractId(yfile));
  if (yfile.getSize() != null) {
    fileType.setSIZE(yfile.getSize());
  }
  if (StringUtils.isNotBlank(yfile.getFormat())) {
    fileType.setMIMETYPE(yfile.getFormat());
  }
  FLocat fLocat = createContentLocation(elementId, yfile);
  fileType.getFLocats().add(fLocat);
  return fileType;
}

代码示例来源: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.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.yadda/yaddaweb-lite-core

String resolvedType = resolveFileType(file.getFormat());  //temporary solution while DL won't support audio/video
if (!"audio".equals(resolvedType) && !"video".equals(resolvedType)) {
  resolvedType = file.getType();
  descr = pdescr = mimeTypeDictionary.getName(file.getFormat(),
    LocaleContextHolder.getLocale());
} else {
String mimeIcon = detailsFilter.filter(mimeIcon(file.getFormat()), InputType.IDENTIFIER, filteringContext);

代码示例来源: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);

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

YContentFile file = (YContentFile) yContentEntry;
String type = file.getType();
if (ocrContentType.equals(type) && format.equalsIgnoreCase(file.getFormat())) {
  ocrContentFound = true;
  ocrContent = file;

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

private List<ContentEntryData> translateContent(List<YContentEntry> contentList, Locale locale, String mainLevel) {
  List<ContentEntryData> result = new ArrayList<ContentEntryData>();
  for (YContentEntry<?> content : contentList) {
    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_PAGED.equals(dir.getType()) && findIfContentExists(dir.getEntries(), mainLevel)) {
        result.add(new ContentDirectoryData(dir.getId(), getDirectoryName(dir), dir.getType(), fetchName(dir.getType(), locale)));
      } else if(findIfContentExists(dir.getEntries(), mainLevel)) {
        result.add(new ContentDirectoryData(dir.getId(), getDirectoryName(dir), dir.getType(), fetchName(dir.getType(), locale), translateContent(dir.getEntries(), locale, mainLevel)));
      }
    }
  }
  return result;
}

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

description.setAttributes(template.getAttributes());
description.setDescriptions(template.getDescriptions());
description.setFormat(template.getFormat());
description.setId(template.getId());
description.setLanguages(template.getLanguages());

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

description.setAttributes(template.getAttributes());
description.setDescriptions(template.getDescriptions());
description.setFormat(template.getFormat());
description.setId(template.getId());
description.setLanguages(template.getLanguages());

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