Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSData


      String aFileName;
      InputStream anInputStream;
     
          if (request.formValueForKey(FormKeys.qqfilename) != null) {
            aFileName = (String) request.formValueForKey(FormKeys.qqfilename);
            NSData data = (NSData) request.formValueForKey(FormKeys.qqfile);
            anInputStream = data.stream();
          } else if (request.formValueForKey(FormKeys.qqfile) != null) {
        aFileName = (String) request.formValueForKey(FormKeys.qqfile);
        anInputStream = (request.contentInputStream() != null) ? request.contentInputStream() : request.content().stream();
          } else {
            log.error("Unable to obtain filename from form values: " + request.formValueKeys());
View Full Code Here


    }
    appendHeadersToResponse(node, response, context);
    Object object = node.toNSCollection(delegate);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ERXPropertyListSerialization.writePropertyListToStream(object, out, ERXPropertyListSerialization.PListFormat.NSPropertyListBinaryFormat_v1_0, CharEncoding.UTF_8);
    response.appendContentData(new NSData(out.toByteArray()));
  }
View Full Code Here

      if (hasBinding(Bindings.data)) {
        if (hasBinding(Bindings.filePath)) {
          NSArray aValue = request.formValuesForKey(uploadName());

          if (aValue != null) {
            NSData data = null;
            try {
              data = (NSData) aValue.objectAtIndex(0);
            } catch (ClassCastException e) {
              throw new ClassCastException("AjaxUploadButton: Value in request was of type '" + aValue.objectAtIndex(0).getClass().getName() + "' instead of NSData. Verify that the WOForm's 'enctype' binding is set to 'multipart/form-data'");
            }
View Full Code Here

  }

  public Object newValueForImmutableBytes(byte bytes[]) {
    Class dataClass = NSData._CLASS;
    Object value = null;
    NSData data = null;
    if (_valueClass == null) {
      _valueClass = _NSUtilities.classWithName(className());//_valueClassName);
      if (_valueClass == null)
        _valueClass = dataClass;
    }
    if (_valueClass == dataClass || _argumentType == FactoryMethodArgumentIsData || _valueFactoryMethod == null) {
      data = new NSData(bytes, new NSRange(0, bytes.length), true);
      if (_valueClass == dataClass || _valueFactoryMethod == null)
        return data;
    }
    switch (_argumentType) {
    default:
View Full Code Here

      }
      break;

    case FactoryMethodArgumentIsData:
      try {
        value = _valueFactoryMethod.invoke(valueFactoryClass()==null?_valueClass:valueFactoryClass(), new NSData(str, CharEncoding.UTF_8));
        if (!NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelInformational, NSLog.DebugGroupDatabaseAccess))
          break;
        if (NSLog.debugLoggingAllowedForLevel(NSLog.DebugLevelDetailed))
          NSLog.debug.appendln(new RuntimeException("Deprecated implicit String->NSData conversion.  Assuming UTF-8 encoding."));
        else
View Full Code Here

    int valueType = adaptorValueType();
   
    //To preserve the illusion of consistency, convert the byte[] to an NSData here
    if(FactoryMethodArgumentIsBytes == factoryMethodArgumentType() && valueFactoryMethod() != null) {
      byte[] bytes = (byte[])convertedValue;
      convertedValue = new NSData(bytes);
    }
   
    //Make an additional check here to support custom date types.
    if(!(AdaptorDateType == valueType && conversionMethod != null && Date.class.isInstance(convertedValue))) {
      if (!valueClasses[valueType].isInstance(convertedValue) && (valueClasses[valueType] != Number.class || !(convertedValue instanceof Boolean))) {
View Full Code Here

                        // for jfreechart-1.0.x use this line
             _imageMap = ImageMapUtilities.getImageMap(_imageMapName, info, toolTipGenerator, urlTagFragmentGenerator);
            // for jfreechart-0.9.x use this line
                        // _imageMap = ImageMapUtil.getImageMap(_imageMapName, info, toolTipGenerator, urlTagFragmentGenerator);
                    }
                    _imageData = new NSData(imageStream.toByteArray());
                }
            } catch (Exception ex) {
                log.error(ex, ex);
                NSForwardException._runtimeExceptionForThrowable(ex);
            }
View Full Code Here

                    .dictionaryForArchive(), "SiteConfig");
            NSMutableDictionary<String, NSMutableDictionary<String, NSDictionary>> updateWotaskd = new NSMutableDictionary<String, NSMutableDictionary<String, NSDictionary>>(
                    data, "sync");
            NSMutableDictionary<String, NSMutableDictionary<String, NSMutableDictionary<String, NSDictionary>>> monitorRequest = new NSMutableDictionary<String, NSMutableDictionary<String, NSMutableDictionary<String, NSDictionary>>>(
                    updateWotaskd, "updateWotaskd");
            NSData content = new NSData((new _JavaMonitorCoder()).encodeRootObjectForKey(monitorRequest,
                    "monitorRequest"));
            _syncRequest = new WORequest(MObject._POST, MObject.directActionString, MObject._HTTP1, aConfig
                    .passwordDictionary(), content, null);
        }
        return _syncRequest;
View Full Code Here

    protected WOResponse sendInstanceRequest(MInstance anInstance, NSDictionary xmlDict) throws MonitorException {
        if (NSLog.debugLoggingAllowedForLevelAndGroups(NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment))
            NSLog.debug.appendln("!@#$!@#$ sendInstanceRequest creates a WOHTTPConnection");

        String contentXML = (new _JavaMonitorCoder()).encodeRootObjectForKey(xmlDict, "instanceRequest");
        NSData content = new NSData(contentXML);

        //        String urlString = MObject.adminActionStringPrefix + anInstance.application().realName() + MObject.adminActionStringPostfix;
        String urlString = MObject.adminActionStringPrefix + anInstance.applicationName() + MObject.adminActionStringPostfix;
        WORequest aRequest = new WORequest(MObject._POST, urlString, MObject._HTTP1, null, content, null);
        WOResponse aResponse = null;
View Full Code Here

      if (jdbcInfoStream == null) {
        throw new IllegalStateException("Unable to find 'JDBCInfo.plist' in this plugin jar.");
      }

      try {
        jdbcInfo = (NSDictionary<String, Object>) NSPropertyListSerialization.propertyListFromData(new NSData(jdbcInfoStream, 2048), "US-ASCII");
      }
      catch (IOException e) {
        throw new RuntimeException("Failed to load 'JDBCInfo.plist' from this plugin jar.", e);
      }
      finally {
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.