File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes help moderator or site admin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "help moderator or site admin" Watch "help moderator or site admin" New topic
Author

help moderator or site admin

mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417
what does this message mean when i tried to post my question, it had code sample as well. The posting was unsuccesful and got this message in the new web page
Sorry, we do not permit this HTML tag: Parenthesis in HTML tag

what is the problem. i have sent an email to moosesaloon@javaranch.com requesting to post my question. Moderator please help in posting my question and also resolve my issue
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
test

[ January 05, 2002: Message edited by: Marilyn deQueiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
test2
()
{}
{()}
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
I'm not seeing a problem either with or without code tags. Can you be more specific?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
I'm finding a problem when I try to post code that includes a for loop. I'll see what I can do to get this resolved.

Meanwhile, here is Mark's code:


Oops. forgot the question he had about the code.
i need help with code. it is printing all the files in the directory. It should not print the file (nono.txt) that was mentioned in the interface FilenameFilter. but the printing includes this file also. i need help with this part only. rest of the code works fine.

[ January 05, 2002: Message edited by: Marilyn deQueiroz ]
Jim Hall
Ranch Hand

Joined: Nov 29, 2001
Posts: 162
In order for it not to print that file you need to do a comparison against the filename and return false. Your method always returns true.
mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417
class Test implements FilenameFilter
{
public static final File pdir = new File("c:\\file1\\test");
public static final String pf = "nono.txt";
public boolean accept( File f , String s )
{
f = pdir ;
s = pf ;
if(s=="nono.txt")return false;return true ;
}
}
is this correct ? well actually i don't get as to how this test condition should work. i tried inverting the condition as well.
In one case all the directory files are listed and in the second case no files are listed. is this how the method list() is supposed to work ?
I had thought that the listing would not include the file that has been mentioned in the method accept. can you please explain how the method accept() works and what is the aim to call the method list()
Originally posted by Jim Hall:
In order for it not to print that file you need to do a comparison against the filename and return false. Your method always returns true.
mark stone
Ranch Hand

Joined: Dec 18, 2001
Posts: 417
reposting as did not get any replies or answers for this....................

Originally posted by mark stone:
class Test implements FilenameFilter
{
public static final File pdir = new File("c:\\file1\\test");
public static final String pf = "nono.txt";
public boolean accept( File f , String s )
{
f = pdir ;
s = pf ;
if(s=="nono.txt")return false;return true ;
}
}
is this correct ? well actually i don't get as to how this test condition should work. i tried inverting the condition as well.
In one case all the directory files are listed and in the second case no files are listed. is this how the method list() is supposed to work ?
I had thought that the listing would not include the file that has been mentioned in the method accept. can you please explain how the method accept() works and what is the aim to call the method list()
Jim Hall
Ranch Hand

Joined: Nov 29, 2001
Posts: 162
Trying to answer this post but this new message board refuses to accept my code. :
[ January 06, 2002: Message edited by: Jim Hall ]
Jim Hall
Ranch Hand

Joined: Nov 29, 2001
Posts: 162

I had substitute < and > for parenthesis because to this error.
[ January 06, 2002: Message edited by: Jim Hall ]
Karen Leoh
Ranch Hand

Joined: Dec 03, 2001
Posts: 40
Hi there...
I am also facing the same problem when posting a new topic... What should I do?
In addition to this... I get the following error message
Sorry, UBB has encountered an unexpected, fatal error. This error is extremely abnormal. Please contact the board administration. The error text is:
Can't open /home/vhost1/www.javaranch.com/vroot/ubb/test.file: Permission denied
Here is the backtrace:
Backtrace: ubb_lib_filehandle.cgi:294 -> sub UBB::FileHandle::tracer
Backtrace: ubb_lib_filehandle.cgi:382 -> sub UBB::FileHandle::_open
Backtrace: ubb_lib_filehandle.cgi:58 -> sub UBB::FileHandle::_open_file
Backtrace: ubb_lib_filehandler.cgi:116 -> sub UBB::FileHandle::new
Backtrace: ubb_lib_files.cgi:519 -> sub UBB::FileHandler: pen
Backtrace: ubb_new_topic.cgi:414 -> sub main::WriteFileAsString
Backtrace: ultimatebb.cgi:603 -> sub main::submit_new_topic
Thanks.
[ January 07, 2002: Message edited by: Karen Leoh ]

--------------------<p>Karen Leoh<br />Sun Certified Programmer for Java™ 2 Platform
Angela Poynton
Ranch Hand

Joined: Mar 02, 2000
Posts: 3143
Please keep all posts regarding problems encountered when posting confined to the Javaranch forum, we have people from Infopop(the people who make the UBB software we use) checking out the problems people are having there.
There have been some problems encountered when we upgraded the UBB software, we are looking into them, however do make yourself heard in the Javaranch forum when you come across a problem.


Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help moderator or site admin
 
Similar Threads
struts and jstl html:option
Thread Dump in Red Hat Linux 2.2
Advanced Java
Has anyone ever got the PetStore Demo to work?
html error when posting