tberthel / gaevfs

Automatically exported from code.google.com/p/gaevfs
Apache License 2.0
0 stars 0 forks source link

invoking updateContentSize failed with error:argument type mismatch #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
<?php
import com.newatlanta.commons.vfs.provider.gae.GaeVFS;
import org.apache.commons.io.IOUtils;
import java.lang.Long;
import java.lang.Boolean;
GaeVFS::setRootPath(quercus_servlet_request()->getSession(true)->getServletConte
xt()->getRealPath('/'));
define('VFSM', GaeVFS::getManager());

//VFSM->resolveFile('gae://gaevfs')->createFolder();
$file=VFSM->resolveFile('gae://gaevfs/tmp1');
//$file->createFile();

$text='pp';
$method=$file->getClass()->getDeclaredMethod('updateContentSize', 
array(Long::TYPE, Boolean::TYPE));
$method->setAccessible(true);
$method->invoke($file, strlen($text), true); //error:argument type mismatch
$out=$file->getContent()->getOutputStream();
IOUtils::write($text, $out, 'UTF8');
$out->close();
?>
the noted error line raise error:argument type mismatch

What is the expected output? What do you see instead?
no error, and updateContentSize successfully

What version of the product are you using? On what operating system?
gaevfs-0.3.jar

Original issue reported on code.google.com by kexianbin@diyism.com on 4 Nov 2011 at 10:11

GoogleCodeExporter commented 9 years ago
I modified the file GaeFileObject.java(add "public" before updateContentSize 
declaration) and recompiled it, and call it directly, everything is ok now.

Original comment by kexianbin@diyism.com on 15 Nov 2011 at 2:52