本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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());
}
}
示例7: getEncodedBytes
import com.intellij.util.Base64Converter; //导入依赖的package包/类
@NotNull
public String getEncodedBytes() {
return Base64Converter.encode(myBytes);
}
示例8: getKeypass
import com.intellij.util.Base64Converter; //导入依赖的package包/类
private String getKeypass(boolean selfSigning) {
return selfSigning ? "keypass" : Base64Converter.decode(getKeypass());
}
示例9: getStorepass
import com.intellij.util.Base64Converter; //导入依赖的package包/类
private String getStorepass(boolean selfSigning) {
return selfSigning ? "storepass" : Base64Converter.decode(getStorepass());
}
示例10: getEncodedBytes
import com.intellij.util.Base64Converter; //导入依赖的package包/类
public String getEncodedBytes() {
return Base64Converter.encode(myBytes);
}