Tabnine Logo
TextLogic
Code IndexAdd Tabnine to your IDE (free)

How to use
TextLogic
in
com.manydesigns.portofino.pageactions.text

Best Java code snippets using com.manydesigns.portofino.pageactions.text.TextLogic (Showing top 5 results out of 315)

origin: com.manydesigns/portofino-pageactions

  public static Attachment deleteAttachmentByCode(TextConfiguration textConfiguration, String code) {
    Attachment attachment = findAttachmentById(textConfiguration, code);
    if (attachment == null) {
      return null;
    } else {
      textConfiguration.getAttachments().remove(attachment);
      return attachment;
    }
  }
}
origin: com.manydesigns/portofino-pageactions

protected void commonUploadAttachment() throws IOException {
  logger.debug("Uploading attachment");
  viewAttachmentUrl = null;
  InputStream attachmentStream = upload.getInputStream();
  String attachmentId = RandomUtil.createRandomId();
  File dataFile = RandomUtil.getCodeFile(
      pageInstance.getDirectory(), ATTACHMENT_FILE_NAME_PATTERN, attachmentId);
  // copy the data
  FileOutputStream fileOutputStream = new FileOutputStream(dataFile);
  IOUtils.copyLarge(attachmentStream, fileOutputStream);
  if(textConfiguration == null) {
    textConfiguration = new TextConfiguration();
  }
  Attachment attachment = TextLogic.createAttachment(
      textConfiguration, attachmentId,
      upload.getFileName(), upload.getContentType(),
      upload.getSize());
  attachment.setDownloadable(uploadDownloadable);
  viewAttachmentUrl =
      generateViewAttachmentUrl(attachmentId);
  saveConfiguration(textConfiguration);
  logger.info("Attachment uploaded: " + upload.getFileName() + " (" + attachmentId + ")");
  IOUtils.closeQuietly(attachmentStream);
  IOUtils.closeQuietly(fileOutputStream);
  upload.delete();
  logger.debug("Upload resources cleaned");
}
origin: com.manydesigns/portofino-pageactions

for (String code : selection) {
  Attachment attachment =
      TextLogic.deleteAttachmentByCode(textConfiguration, code);
  if (attachment == null) {
    logger.warn("Ignoring non-existing attachment with code: {}", code);
origin: ManyDesigns/Portofino

  public static Attachment deleteAttachmentByCode(TextConfiguration textConfiguration, String code) {
    Attachment attachment = findAttachmentById(textConfiguration, code);
    if (attachment == null) {
      return null;
    } else {
      textConfiguration.getAttachments().remove(attachment);
      return attachment;
    }
  }
}
origin: com.manydesigns/portofino-pageactions

TextLogic.findAttachmentById(textConfiguration, id);
com.manydesigns.portofino.pageactions.textTextLogic

Most used methods

  • findAttachmentById
  • createAttachment
  • deleteAttachmentByCode

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Menu (java.awt)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JList (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now