java.net.URLConnection.checkNotConnected()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(160)

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

URLConnection.checkNotConnected介绍

暂无

代码示例

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

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

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

  1. /**
  2. * Sets the flag indicating whether this {@code URLConnection} allows input.
  3. * It cannot be set after the connection is established.
  4. *
  5. * @param newValue
  6. * the new value for the flag to be set.
  7. * @throws IllegalAccessError
  8. * if this method attempts to change the value after the
  9. * connection has been already established.
  10. * @see #doInput
  11. */
  12. public void setDoInput(boolean newValue) {
  13. checkNotConnected();
  14. this.doInput = newValue;
  15. }

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

  1. /**
  2. * Sets the flag indicating whether this connection allows to use caches or
  3. * not. This method can only be called prior to the connection
  4. * establishment.
  5. *
  6. * @param newValue
  7. * the value of the flag to be set.
  8. * @throws IllegalStateException
  9. * if this method attempts to change the flag after the
  10. * connection has been established.
  11. * @see #useCaches
  12. */
  13. public void setUseCaches(boolean newValue) {
  14. checkNotConnected();
  15. this.useCaches = newValue;
  16. }

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

  1. /**
  2. * Returns the value of the request header property specified by {code field}
  3. * or {@code null} if there is no field with this name. The base
  4. * implementation of this method returns always {@code null}.
  5. *
  6. * @param field
  7. * the name of the request header property.
  8. * @return the value of the property.
  9. * @throws IllegalStateException
  10. * if the connection has been already established.
  11. */
  12. public String getRequestProperty(String field) {
  13. checkNotConnected();
  14. return null;
  15. }

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

  1. /**
  2. * Sets the flag indicating whether this {@code URLConnection} allows
  3. * output. It cannot be set after the connection is established.
  4. *
  5. * @param newValue
  6. * the new value for the flag to be set.
  7. * @throws IllegalAccessError
  8. * if this method attempts to change the value after the
  9. * connection has been already established.
  10. * @see #doOutput
  11. */
  12. public void setDoOutput(boolean newValue) {
  13. checkNotConnected();
  14. this.doOutput = newValue;
  15. }

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

  1. /**
  2. * Sets the point of time since when the data must be modified to be
  3. * transmitted. Some protocols transmit data only if it has been modified
  4. * more recently than a particular time. The data will be transmitted
  5. * regardless of its timestamp if this option is set to {@code 0}.
  6. *
  7. * @param newValue
  8. * the time in milliseconds since January 1, 1970 GMT.
  9. * @throws IllegalStateException
  10. * if this {@code URLConnection} has already been connected.
  11. * @see #ifModifiedSince
  12. */
  13. public void setIfModifiedSince(long newValue) {
  14. checkNotConnected();
  15. this.ifModifiedSince = newValue;
  16. }

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

  1. /**
  2. * Returns an unmodifiable map of general request properties used by this
  3. * connection. The request property names are the key values of the map. The
  4. * map values are lists of property values of the corresponding key name.
  5. *
  6. * @return the request-property representing generic map.
  7. * @since 1.4
  8. */
  9. public Map<String, List<String>> getRequestProperties() {
  10. checkNotConnected();
  11. return Collections.emptyMap();
  12. }

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

  1. /**
  2. * Adds the given property to the request header. Existing properties with
  3. * the same name will not be overwritten by this method.
  4. *
  5. * @param field
  6. * the request property field name to add.
  7. * @param newValue
  8. * the value of the property which is to add.
  9. * @throws IllegalStateException
  10. * if the connection has been already established.
  11. * @throws NullPointerException
  12. * if the property name is {@code null}.
  13. * @since 1.4
  14. */
  15. public void addRequestProperty(String field, String newValue) {
  16. checkNotConnected();
  17. if (field == null) {
  18. throw new NullPointerException("field == null");
  19. }
  20. }

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

  1. /**
  2. * Sets the value of the specified request header field. The value will only
  3. * be used by the current {@code URLConnection} instance. This method can
  4. * only be called before the connection is established.
  5. *
  6. * @param field
  7. * the request header field to be set.
  8. * @param newValue
  9. * the new value of the specified property.
  10. * @throws IllegalStateException
  11. * if the connection has been already established.
  12. * @throws NullPointerException
  13. * if the parameter {@code field} is {@code null}.
  14. */
  15. public void setRequestProperty(String field, String newValue) {
  16. checkNotConnected();
  17. if (field == null) {
  18. throw new NullPointerException("field == null");
  19. }
  20. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

代码示例来源:origin: com.jtransc/jtransc-rt

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Sets {@code allowUserInteraction}. Unused by Android.
  3. */
  4. public void setAllowUserInteraction(boolean newValue) {
  5. checkNotConnected();
  6. this.allowUserInteraction = newValue;
  7. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns an unmodifiable map of general request properties used by this
  3. * connection. The request property names are the key values of the map. The
  4. * map values are lists of property values of the corresponding key name.
  5. *
  6. * @return the request-property representing generic map.
  7. * @since 1.4
  8. */
  9. public Map<String, List<String>> getRequestProperties() {
  10. checkNotConnected();
  11. return Collections.emptyMap();
  12. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns an unmodifiable map of general request properties used by this
  3. * connection. The request property names are the key values of the map. The
  4. * map values are lists of property values of the corresponding key name.
  5. *
  6. * @return the request-property representing generic map.
  7. * @since 1.4
  8. */
  9. public Map<String, List<String>> getRequestProperties() {
  10. checkNotConnected();
  11. return Collections.emptyMap();
  12. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Returns an unmodifiable map of general request properties used by this
  3. * connection. The request property names are the key values of the map. The
  4. * map values are lists of property values of the corresponding key name.
  5. *
  6. * @return the request-property representing generic map.
  7. * @since 1.4
  8. */
  9. public Map<String, List<String>> getRequestProperties() {
  10. checkNotConnected();
  11. return Collections.emptyMap();
  12. }

代码示例来源:origin: com.jtransc/jtransc-rt

  1. /**
  2. * Returns an unmodifiable map of general request properties used by this
  3. * connection. The request property names are the key values of the map. The
  4. * map values are lists of property values of the corresponding key name.
  5. *
  6. * @return the request-property representing generic map.
  7. * @since 1.4
  8. */
  9. public Map<String, List<String>> getRequestProperties() {
  10. checkNotConnected();
  11. return Collections.emptyMap();
  12. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns an unmodifiable map of general request properties used by this
  3. * connection. The request property names are the key values of the map. The
  4. * map values are lists of property values of the corresponding key name.
  5. *
  6. * @return the request-property representing generic map.
  7. * @since 1.4
  8. */
  9. public Map<String, List<String>> getRequestProperties() {
  10. checkNotConnected();
  11. return Collections.emptyMap();
  12. }

相关文章

URLConnection类方法