Updated project structure, and created ant build file
This commit is contained in:
parent
09cce4d80a
commit
d1fbc1c50b
20 changed files with 125 additions and 62 deletions
|
|
@ -27,6 +27,7 @@ import zall.util.msg.UserMessage;
|
|||
import zall.util.msg.UserMessage.MessageType;
|
||||
import zutil.db.DBConnection;
|
||||
import zutil.db.bean.DBBean;
|
||||
import zutil.db.bean.DBBeanSQLResultHandler;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
public class Zallery extends HttpServlet{
|
||||
|
|
@ -78,7 +79,7 @@ public class Zallery extends HttpServlet{
|
|||
}
|
||||
|
||||
public void destroy(){
|
||||
DBBean.cancelGBC();
|
||||
|
||||
}
|
||||
|
||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException{
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class Image extends Media{
|
|||
case ORIGINAL:
|
||||
return folder.getFile( filename, Size.ORIGINAL );
|
||||
default:
|
||||
File file = folder.getFile( FileUtil.changeExtension(filename, IMAGE_FORMAT), size );
|
||||
File file = folder.getFile( FileUtil.replaceExtension(filename, IMAGE_FORMAT), size );
|
||||
File orgFile = folder.getFile( filename, Size.ORIGINAL );
|
||||
if( !file.exists() ){
|
||||
if(orgFile.exists() && orgFile.canRead() ){
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import zutil.db.DBConnection;
|
|||
import zutil.db.bean.DBBean;
|
||||
import zutil.db.bean.DBBeanSQLResultHandler;
|
||||
import zutil.db.bean.DBBean.*;
|
||||
import zutil.db.handler.SimpleSQLHandler;
|
||||
import zutil.db.handler.SimpleSQLResult;
|
||||
|
||||
@DBTable("User")
|
||||
public class User extends DBBean{
|
||||
|
|
@ -141,7 +141,7 @@ public class User extends DBBean{
|
|||
"SELECT email FROM User WHERE email=? LIMIT 1");
|
||||
sql.setString(1, email);
|
||||
|
||||
String tmp = DBConnection.exec(sql, new SimpleSQLHandler<String>());
|
||||
String tmp = DBConnection.exec(sql, new SimpleSQLResult<String>());
|
||||
return tmp != null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ public class Video extends Media{
|
|||
public File getFile(Size size) throws IOException{
|
||||
if( filename != null ){
|
||||
if( size == Size.SMALL )
|
||||
return folder.getFile( FileUtil.changeExtension(filename, Image.IMAGE_FORMAT), size );
|
||||
return folder.getFile( FileUtil.replaceExtension(filename, Image.IMAGE_FORMAT), size );
|
||||
else if( size == Size.MEDIUM )
|
||||
return folder.getFile( FileUtil.changeExtension(filename, VIDEO_FORMAT), size );
|
||||
return folder.getFile( FileUtil.replaceExtension(filename, VIDEO_FORMAT), size );
|
||||
else
|
||||
return folder.getFile( filename, size );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class FBUser {
|
|||
public void load(){
|
||||
try {
|
||||
InputStream stream = fbc.getServiceURL( uid ).openStream();
|
||||
String data = IOUtil.getContent( stream );
|
||||
String data = IOUtil.readContentAsString( stream );
|
||||
DataNode node = JSONParser.read( data );
|
||||
|
||||
logger.finer("User("+uid+") data from Facebook: "+data);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public class FacebookConnect {
|
|||
String[] attrib = value.split("\\.", 2);
|
||||
String signature = Base64Decoder.decodeToHex( attrib[0] );
|
||||
System.out.println( signature );
|
||||
attrib[1] = Base64Decoder.addPadding( attrib[1] );
|
||||
//attrib[1] = Base64Decoder.addPadding( attrib[1] );
|
||||
String data = Base64Decoder.decode( attrib[1] );
|
||||
DataNode map = JSONParser.read( data );
|
||||
System.out.println(map);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue