当前位置: 首页>>代码示例>>Java>>正文


Java Base64Converter类代码示例

本文整理汇总了Java中com.intellij.util.Base64Converter的典型用法代码示例。如果您正苦于以下问题:Java Base64Converter类的具体用法?Java Base64Converter怎么用?Java Base64Converter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Base64Converter类属于com.intellij.util包,在下文中一共展示了Base64Converter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBytesFromDataUri

import com.intellij.util.Base64Converter; //导入依赖的package包/类
/**
 * Extracts byte array from given data:URL string.
 * data:URL will be decoded from base64 if it contains the marker of base64 encoding.
 *
 * @param dataUrl data:URL-like string (may be quoted)
 * @return extracted byte array or {@code null} if it cannot be extracted.
 */
@Nullable
public static byte[] getBytesFromDataUri(@NotNull String dataUrl) {
  Matcher matcher = DATA_URI_PATTERN.matcher(StringUtil.unquoteString(dataUrl));
  if (matcher.matches()) {
    try {
      String content = matcher.group(4);
      return ";base64".equalsIgnoreCase(matcher.group(3))
             ? Base64Converter.decode(content.getBytes(CharsetToolkit.UTF8_CHARSET))
             : content.getBytes(CharsetToolkit.UTF8_CHARSET);
    }
    catch (IllegalArgumentException e) {
      return null;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:URLUtil.java

示例2: JavaFxEditCertificatesDialog

import com.intellij.util.Base64Converter; //导入依赖的package包/类
protected JavaFxEditCertificatesDialog(JComponent parent, JavaFxArtifactProperties properties, Project project) {
  super(parent, true);
  setTitle("Choose Certificate");
  init();
  final ActionListener actionListener = new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      UIUtil.setEnabled(myPanel.myKeysPanel, !myPanel.mySelfSignedRadioButton.isSelected(), true);
    }
  };
  myPanel.mySelfSignedRadioButton.addActionListener(actionListener);
  myPanel.mySignedByKeyRadioButton.addActionListener(actionListener);
  final boolean selfSigning = properties.isSelfSigning();
  UIUtil.setEnabled(myPanel.myKeysPanel, !selfSigning, true);
  myPanel.mySelfSignedRadioButton.setSelected(selfSigning);
  myPanel.mySignedByKeyRadioButton.setSelected(!selfSigning);

  myPanel.myAliasTF.setText(properties.getAlias());
  myPanel.myKeystore.setText(properties.getKeystore());
  final String keypass = properties.getKeypass();
  myPanel.myKeypassTF.setText(keypass != null ? Base64Converter.decode(keypass) : "");
  final String storepass = properties.getStorepass();
  myPanel.myStorePassTF.setText(storepass != null ? Base64Converter.decode(storepass) : "");
  myPanel.myKeystore.addBrowseFolderListener("Choose Keystore File", "Select file containing generated keys", project, BrowseFilesListener.SINGLE_FILE_DESCRIPTOR);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JavaFxEditCertificatesDialog.java

示例3: isModified

import com.intellij.util.Base64Converter; //导入依赖的package包/类
@Override
public boolean isModified() {
  if (isModified(myProperties.getTitle(), myTitleTF)) return true;
  if (isModified(myProperties.getVendor(), myVendorTF)) return true;
  if (isModified(myProperties.getDescription(), myDescriptionEditorPane)) return true;
  if (isModified(myProperties.getWidth(), myWidthTF)) return true;
  if (isModified(myProperties.getHeight(), myHeightTF)) return true;
  if (isModified(myProperties.getAppClass(), myAppClass)) return true;
  if (isModified(myProperties.getHtmlParamFile(), myHtmlParams)) return true;
  if (isModified(myProperties.getParamFile(), myParams)) return true;
  if (!Comparing.equal(myNativeBundleCB.getSelectedItem(), myProperties.getNativeBundle())) return true;
  final boolean inBackground = Comparing.strEqual(myProperties.getUpdateMode(), JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND);
  if (inBackground != myUpdateInBackgroundCB.isSelected()) return true;
  if (myProperties.isEnabledSigning() != myEnableSigningCB.isSelected()) return true;
  if (myProperties.isConvertCss2Bin() != myConvertCssToBinCheckBox.isSelected()) return true;
  if (myDialog != null) {
    if (isModified(myProperties.getAlias(), myDialog.myPanel.myAliasTF)) return true;
    if (isModified(myProperties.getKeystore(), myDialog.myPanel.myKeystore)) return true;
    final String keypass = myProperties.getKeypass();
    if (isModified(keypass != null ? Base64Converter.decode(keypass) : "", myDialog.myPanel.myKeypassTF)) return true;
    final String storepass = myProperties.getStorepass();
    if (isModified(storepass != null ? Base64Converter.decode(storepass) : "", myDialog.myPanel.myStorePassTF)) return true;
    if (myProperties.isSelfSigning() != myDialog.myPanel.mySelfSignedRadioButton.isSelected()) return true;
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:JavaFxArtifactPropertiesEditor.java

示例4: apply

import com.intellij.util.Base64Converter; //导入依赖的package包/类
@Override
public void apply() {
  myProperties.setTitle(myTitleTF.getText());
  myProperties.setVendor(myVendorTF.getText());
  myProperties.setDescription(myDescriptionEditorPane.getText());
  myProperties.setAppClass(myAppClass.getText());
  myProperties.setWidth(myWidthTF.getText());
  myProperties.setHeight(myHeightTF.getText());
  myProperties.setHtmlParamFile(myHtmlParams.getText());
  myProperties.setParamFile(myParams.getText());
  myProperties.setUpdateMode(myUpdateInBackgroundCB.isSelected() ? JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND 
                                                                 : JavaFxPackagerConstants.UPDATE_MODE_ALWAYS);
  myProperties.setEnabledSigning(myEnableSigningCB.isSelected());
  myProperties.setConvertCss2Bin(myConvertCssToBinCheckBox.isSelected());
  myProperties.setNativeBundle((String)myNativeBundleCB.getSelectedItem());
  if (myDialog != null) {
    myProperties.setSelfSigning(myDialog.myPanel.mySelfSignedRadioButton.isSelected());
    myProperties.setAlias(myDialog.myPanel.myAliasTF.getText());
    myProperties.setKeystore(myDialog.myPanel.myKeystore.getText());
    final String keyPass = String.valueOf((myDialog.myPanel.myKeypassTF.getPassword()));
    myProperties.setKeypass(!StringUtil.isEmptyOrSpaces(keyPass) ? Base64Converter.encode(keyPass) : null);
    final String storePass = String.valueOf(myDialog.myPanel.myStorePassTF.getPassword());
    myProperties.setStorepass(!StringUtil.isEmptyOrSpaces(storePass) ? Base64Converter.encode(storePass) : null);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:JavaFxArtifactPropertiesEditor.java

示例5: isModified

import com.intellij.util.Base64Converter; //导入依赖的package包/类
@Override
public boolean isModified() {
  if (isModified(myProperties.getTitle(), myTitleTF)) return true;
  if (isModified(myProperties.getVendor(), myVendorTF)) return true;
  if (isModified(myProperties.getDescription(), myDescriptionEditorPane)) return true;
  if (isModified(myProperties.getWidth(), myWidthTF)) return true;
  if (isModified(myProperties.getHeight(), myHeightTF)) return true;
  if (isModified(myProperties.getAppClass(), myAppClass)) return true;
  if (isModified(myProperties.getHtmlParamFile(), myHtmlParams)) return true;
  if (isModified(myProperties.getParamFile(), myParams)) return true;
  if (!Comparing.equal(myNativeBundleCB.getSelectedItem(), myProperties.getNativeBundle())) return true;
  final boolean inBackground = Comparing.strEqual(myProperties.getUpdateMode(), JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND);
  if (inBackground != myUpdateInBackgroundCB.isSelected()) return true;
  if (myProperties.isEnabledSigning() != myEnableSigningCB.isSelected()) return true;
  if (myProperties.isConvertCss2Bin() != myConvertCssToBinCheckBox.isSelected()) return true;
  if (myDialog != null) {
    if (isModified(myProperties.getAlias(), myDialog.myPanel.myAliasTF)) return true;
    if (isModified(myProperties.getKeystore(), myDialog.myPanel.myKeystore)) return true;
    final String keypass = myProperties.getKeypass();
    if (isModified(keypass != null ? Base64Converter.decode(keypass) : "", myDialog.myPanel.myKeypassTF)) return true;
    final String storepass = myProperties.getStorepass();
    if (isModified(storepass != null ? Base64Converter.decode(storepass) : "", myDialog.myPanel.myStorePassTF)) return true;
    if (myProperties.isSelfSigning() != myDialog.myPanel.mySelfSignedRadioButton.isSelected()) return true;
  }

  if (myManifestAttributesDialog != null) {
    if (!Comparing.equal(myManifestAttributesDialog.getAttrs(), myProperties.getCustomManifestAttributes())) return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:JavaFxArtifactPropertiesEditor.java

示例6: apply

import com.intellij.util.Base64Converter; //导入依赖的package包/类
@Override
public void apply() {
  myProperties.setTitle(myTitleTF.getText());
  myProperties.setVendor(myVendorTF.getText());
  myProperties.setDescription(myDescriptionEditorPane.getText());
  myProperties.setAppClass(myAppClass.getText());
  myProperties.setWidth(myWidthTF.getText());
  myProperties.setHeight(myHeightTF.getText());
  myProperties.setHtmlParamFile(myHtmlParams.getText());
  myProperties.setParamFile(myParams.getText());
  myProperties.setUpdateMode(myUpdateInBackgroundCB.isSelected() ? JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND
                                                                 : JavaFxPackagerConstants.UPDATE_MODE_ALWAYS);
  myProperties.setEnabledSigning(myEnableSigningCB.isSelected());
  myProperties.setConvertCss2Bin(myConvertCssToBinCheckBox.isSelected());
  myProperties.setNativeBundle((String)myNativeBundleCB.getSelectedItem());
  if (myDialog != null) {
    myProperties.setSelfSigning(myDialog.myPanel.mySelfSignedRadioButton.isSelected());
    myProperties.setAlias(myDialog.myPanel.myAliasTF.getText());
    myProperties.setKeystore(myDialog.myPanel.myKeystore.getText());
    final String keyPass = String.valueOf((myDialog.myPanel.myKeypassTF.getPassword()));
    myProperties.setKeypass(!StringUtil.isEmptyOrSpaces(keyPass) ? Base64Converter.encode(keyPass) : null);
    final String storePass = String.valueOf(myDialog.myPanel.myStorePassTF.getPassword());
    myProperties.setStorepass(!StringUtil.isEmptyOrSpaces(storePass) ? Base64Converter.encode(storePass) : null);
  }

  if (myManifestAttributesDialog != null) {
    myProperties.setCustomManifestAttributes(myManifestAttributesDialog.getAttrs());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:JavaFxArtifactPropertiesEditor.java

示例7: getEncodedBytes

import com.intellij.util.Base64Converter; //导入依赖的package包/类
@NotNull
public String getEncodedBytes() {
  return Base64Converter.encode(myBytes);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:Attachment.java

示例8: getKeypass

import com.intellij.util.Base64Converter; //导入依赖的package包/类
private String getKeypass(boolean selfSigning) {
  return selfSigning ? "keypass" : Base64Converter.decode(getKeypass());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AbstractJavaFxPackager.java

示例9: getStorepass

import com.intellij.util.Base64Converter; //导入依赖的package包/类
private String getStorepass(boolean selfSigning) {
  return selfSigning ? "storepass" : Base64Converter.decode(getStorepass());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AbstractJavaFxPackager.java

示例10: getEncodedBytes

import com.intellij.util.Base64Converter; //导入依赖的package包/类
public String getEncodedBytes() {
  return Base64Converter.encode(myBytes);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:Attachment.java


注:本文中的com.intellij.util.Base64Converter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。