Examples of NSData


Examples of com.webobjects.foundation.NSData

    @Override
    public void init(EOEditingContext ec) {
        super.init(ec);
        ERIFileContent content = ERIFileContent.clazz.createAndInsertObject(ec);
        setContent(content);
        setContentData(new NSData());
    }
View Full Code Here

Examples of com.webobjects.foundation.NSData

      if (hasBinding("filePath")) {
        setValueForBinding(progress.fileName(), "filePath");
      }

      if (hasBinding("data")) {
        NSData data = new NSData(progress.tempFile().toURI().toURL());
        setValueForBinding(data, "data");
      }
     
      if (hasBinding("mimeType")) {
        String contentType = progress.contentType();
View Full Code Here

Examples of com.webobjects.foundation.NSData

   * @see #propertyListFromData(NSData, java.lang.String)
   */
  public static NSData dataFromPropertyList(Object plist, String encoding) {
    if (plist == null)
      return null;
    return new NSData(_NSStringUtilities.bytesForString(stringFromPropertyList(plist), encoding));
  }
View Full Code Here

Examples of com.webobjects.foundation.NSData

          }
        }
        if (attribute().className().contains("NSTimestamp")) {
          return new NSTimestamp(DateTools.stringToDate(value));
        } else if (attribute().className().contains("NSData")) {
          return new NSData((NSData) NSPropertyListSerialization.propertyListFromString(value));
        } else if (attribute().className().contains("NSArray")) {
          return NSArray.componentsSeparatedByString(value, " ");
        }
        return value.toString();
      } catch (ParseException ex) {
View Full Code Here

Examples of com.webobjects.foundation.NSData

        try {
          pkValue = ERXEOControlUtilities.primaryKeyObjectForObject(eo);
          if (pkValue == null) {
            EOGlobalID gid = editingContext.globalIDForObject(eo);
            if (gid instanceof EOTemporaryGlobalID) {
              pkValue = new NSData(((EOTemporaryGlobalID) gid)._rawBytes());
            }
          }
        }
        finally {
          editingContext.unlock();
View Full Code Here

Examples of com.webobjects.foundation.NSData

//          pkValue = new NSData(buf.getRawData());
//        } catch (IOException e) {
//          throw NSForwardException._runtimeExceptionForThrowable(e);
//        }
//      } else {
        pkValue = new NSData(new EOTemporaryGlobalID()._rawBytes());
//      }
    } else {
      throw new IllegalArgumentException("Unknown value type '" + valueType + "' for '" + object + "' of entity '" + entity.name() + "'.");
    }
    NSDictionary pk = new NSDictionary<String, Object>(pkValue, pkAttribute.name());
View Full Code Here

Examples of com.webobjects.foundation.NSData

        throw new IOException("Property list input stream cannot be null");
      }
      boolean parsed = false;
      BufferedInputStream bis = new BufferedInputStream(is);

      NSData data = new NSData(bis, -1); // bigger chunk size?
      byte[] theBytes = data.bytes();

      // Parse the HEADER
      // ----------------
      // magic number ("bplist")
      // file format version ("00")
View Full Code Here

Examples of com.webobjects.foundation.NSData

     * @param index
     * @param count
     * @throws IOException
     */
    private void parseData(byte[] bytes, int index, int count) throws IOException {
      objectTable.add(new NSData(bytes, index, count));
    }
View Full Code Here

Examples of com.webobjects.foundation.NSData

    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(bout);
      oos.writeObject(d);
      oos.close();
      NSData sp = new NSData(bout.toByteArray());
      return sp;
    } catch (IOException e) {
      // shouldn't ever happen, as we only write to memory
      throw NSForwardException._runtimeExceptionForThrowable(e);
    }
View Full Code Here

Examples of com.webobjects.foundation.NSData

              if(rawValue instanceof NSMutableData) {
                  // AK: wtf!! I got an exception
                  // java.lang.IllegalArgumentException: Attempt to create an EOGlobalID for the entity "Asset" with a primary key component of type com.webobjects.foundation.NSMutableData instead of type com.webobjects.foundation.NSData!
                  // so this is a lame attempt to fix it.
                 
                rawValue = new NSData((NSMutableData)rawValue);
              }
                EOAttribute attribute = pks.objectAtIndex(0);
                Object value = rawValue;
                value = attribute.validateValue(value);
                pk.setObjectForKey(value, attribute.name());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.