java.lang.SecurityException.toString()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(96)

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

SecurityException.toString介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Create a new object input.
* @param is underlying input stream
* @throws IOException for the usual reasons
*/
public NbObjectInputStream(InputStream is) throws IOException {
  super(is);
  try {
    enableResolveObject(true);
  } catch (SecurityException ex) {
    throw new IOException(ex.toString());
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Create a new object output.
* @param os the underlying output stream
* @throws IOException for the usual reasons
*/
public NbObjectOutputStream(OutputStream os) throws IOException {
  super(os);
  try {
    enableReplaceObject(true);
  } catch (SecurityException ex) {
    throw (IOException) new IOException(ex.toString()).initCause(ex);
  }
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
protected synchronized Class<?> loadClass( String arg0, boolean arg1 ) throws ClassNotFoundException {
 try {
  return loadClassFromThisLoader( arg0, arg1 );
 } catch ( ClassNotFoundException | NoClassDefFoundError e ) {
  // ignore
 } catch ( SecurityException e ) {
  System.err.println( BaseMessages.getString( PKG, "KettleURLClassLoader.Exception.UnableToLoadClass",
      e.toString() ) );
 }
 return loadClassFromParent( arg0, arg1 );
}

代码示例来源:origin: apache/geode

/**
 * Init method to populate the TIntObjectHashMap for Non-english locales
 * <code>data = new TIntObjectHashMap();</code>
 *
 * The default bundle, English, will be <code>data = null</code>
 */
private void initData(String baseName, Locale l) {
 StringBuffer sb = new StringBuffer(baseName);
 sb.append("_").append(l.getLanguage()).append(".txt");
 String resource = sb.toString();
 InputStream is = null;
 try {
  is = ClassPathLoader.getLatest().getResourceAsStream(getClass(), resource);
 } catch (SecurityException se) {
  // We do not have a logger yet
  System.err.println(
    "A SecurityException occurred while attempting to load the resource bundle, defaulting to English."
      + se.toString());
  se.printStackTrace();
  System.err.flush();
 }
 if (is == null) {
  // No matching data file for the requested langauge,
  // defaulting to English
  data = null;
 } else {
  data = readDataFile(is);
 }
}

代码示例来源:origin: Alluxio/alluxio

LOG.info("Not registering metrics shutdown hook due to security exception. Regular "
  + "heartbeats will still be performed to collect metrics data, but no final heartbeat "
  + "will be performed on JVM exit. Security exception: {}", e.toString());

代码示例来源:origin: geotools/geotools

XSISAXHandler.logger.warning(e1.toString());
} catch (SecurityException e1) {
  XSISAXHandler.logger.warning(e1.toString());
} catch (IllegalAccessException e1) {
  XSISAXHandler.logger.warning(e1.toString());

代码示例来源:origin: omadahealth/LolliPin

/**
 * Init {@link FingerprintManager} of the {@link android.os.Build.VERSION#SDK_INT} is > to Marshmallow
 * and {@link FingerprintManager#isHardwareDetected()}.
 */
private void initLayoutForFingerprint() {
  mFingerprintImageView = (ImageView) this.findViewById(R.id.pin_code_fingerprint_imageview);
  mFingerprintTextView = (TextView) this.findViewById(R.id.pin_code_fingerprint_textview);
  if (mType == AppLock.UNLOCK_PIN && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    mFingerprintManager = (FingerprintManager) getSystemService(Context.FINGERPRINT_SERVICE);
    mFingerprintUiHelper = new FingerprintUiHelper.FingerprintUiHelperBuilder(mFingerprintManager).build(mFingerprintImageView, mFingerprintTextView, this);
    try {
    if (mFingerprintManager.isHardwareDetected() && mFingerprintUiHelper.isFingerprintAuthAvailable()
        && mLockManager.getAppLock().isFingerprintAuthEnabled()) {
        mFingerprintImageView.setVisibility(View.VISIBLE);
        mFingerprintTextView.setVisibility(View.VISIBLE);
        mFingerprintUiHelper.startListening();
      } else {
        mFingerprintImageView.setVisibility(View.GONE);
        mFingerprintTextView.setVisibility(View.GONE);
      }
    } catch (SecurityException e) {
      Log.e(TAG, e.toString());
      mFingerprintImageView.setVisibility(View.GONE);
      mFingerprintTextView.setVisibility(View.GONE);
    }
  } else {
    mFingerprintImageView.setVisibility(View.GONE);
    mFingerprintTextView.setVisibility(View.GONE);
  }
}

代码示例来源:origin: apache/cloudstack

private void launchAgentFromClassInfo(String resourceClassNames) throws ConfigurationException {
  String[] names = resourceClassNames.split("\\|");
  for (String name : names) {
    Class<?> impl;
    try {
      impl = Class.forName(name);
      final Constructor<?> constructor = impl.getDeclaredConstructor();
      constructor.setAccessible(true);
      ServerResource resource = (ServerResource)constructor.newInstance();
      launchNewAgent(resource);
    } catch (final ClassNotFoundException e) {
      throw new ConfigurationException("Resource class not found: " + name + " due to: " + e.toString());
    } catch (final SecurityException e) {
      throw new ConfigurationException("Security excetion when loading resource: " + name + " due to: " + e.toString());
    } catch (final NoSuchMethodException e) {
      throw new ConfigurationException("Method not found excetion when loading resource: " + name + " due to: " + e.toString());
    } catch (final IllegalArgumentException e) {
      throw new ConfigurationException("Illegal argument excetion when loading resource: " + name + " due to: " + e.toString());
    } catch (final InstantiationException e) {
      throw new ConfigurationException("Instantiation excetion when loading resource: " + name + " due to: " + e.toString());
    } catch (final IllegalAccessException e) {
      throw new ConfigurationException("Illegal access exception when loading resource: " + name + " due to: " + e.toString());
    } catch (final InvocationTargetException e) {
      throw new ConfigurationException("Invocation target exception when loading resource: " + name + " due to: " + e.toString());
    }
  }
}

代码示例来源:origin: kaitoy/pcap4j

newPacket = clazz.getMethod("newPacket", byte[].class, int.class, int.class);
} catch (SecurityException e) {
 fail(e.toString());
} catch (NoSuchMethodException e) {
 fail(e.toString());

代码示例来源:origin: xap/xap

@Override
  public String toString() {
    return "SpaceSecurityException() " + super.toString();
  }
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

getLogger().debug( e.toString() );
throw new ArchiverException(
  "Not allowed to rename old file (" + zipFile.getAbsolutePath() + ") to temporary file", e );

代码示例来源:origin: in.jlibs/org-openide-util

/** Create a new object input.
* @param is underlying input stream
* @throws IOException for the usual reasons
*/
public NbObjectInputStream(InputStream is) throws IOException {
  super(is);
  try {
    enableResolveObject(true);
  } catch (SecurityException ex) {
    throw new IOException(ex.toString());
  }
}

代码示例来源:origin: ymnk/jsch-agent-proxy

public Socket open(String path) throws IOException {
  Process p = null;
  try {
   p = Runtime.getRuntime().exec("nc -U "+path);
  }
  catch (SecurityException e){
   throw new IOException(e.toString());
  }
  return new MySocket(p);
 }
}

代码示例来源:origin: jjoe64/GraphView-Demos

public void snapshot() {
  try {
    graph.takeSnapshotAndShare(mActivity, "exampleGraph", "GraphViewSnapshot");
  } catch (SecurityException e) {
    e.printStackTrace();
    Toast.makeText(mActivity, "Permission problem. See log " + e.toString(), Toast.LENGTH_SHORT).show();
  }
}

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

/** Create a new object input.
* @param is underlying input stream
* @throws IOException for the usual reasons
*/
public NbObjectInputStream(InputStream is) throws IOException {
  super(is);
  try {
    enableResolveObject(true);
  } catch (SecurityException ex) {
    throw new IOException(ex.toString());
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-platform-mbean

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
  try {
    ManagementFactory.getThreadMXBean().resetPeakThreadCount();
  } catch (SecurityException e) {
    throw new OperationFailedException(new ModelNode().set(e.toString()));
  }
  context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}

代码示例来源:origin: org.jboss.as/jboss-as-platform-mbean

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
  try {
    getMemoryPoolMXBean(operation).resetPeakUsage();
  } catch (SecurityException e) {
    throw new OperationFailedException(new ModelNode().set(e.toString()));
  }
  context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}

代码示例来源:origin: org.wildfly.core/wildfly-platform-mbean

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
  try {
    ManagementFactory.getThreadMXBean().resetPeakThreadCount();
  } catch (SecurityException e) {
    throw new OperationFailedException(e.toString());
  }
  context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}

代码示例来源:origin: org.wildfly.core/wildfly-platform-mbean

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
  try {
    getMemoryPoolMXBean(operation).resetPeakUsage();
  } catch (SecurityException e) {
    throw new OperationFailedException(e.toString());
  }
  context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}

代码示例来源:origin: wildfly/wildfly-core

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
  try {
    getMemoryPoolMXBean(operation).resetPeakUsage();
  } catch (SecurityException e) {
    throw new OperationFailedException(e.toString());
  }
  context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}

相关文章