Board index » jbuilder » Help!

Help!


2003-07-11 02:31:36 AM
jbuilder12
Help!
I'm really stuck on this. Can you help me out?
Again, I need to get a list of files in a directory within the jar.
Thanks!
 
 

Re:Help!

hi,
On Thu, 10 Jul 2003 14:31:36 -0400, Nechama Shuchatowitz wrote:
Quote
Help!
I'm really stuck on this. Can you help me out?
Again, I need to get a list of files in a directory within the jar.
Thanks!
Sorry, i forgot :( but .. here we are (i hope, pan don't touch code format):
<code>
import java.io.*;
import java.util.*;
import java.util.jar.*;
public class Jar
{
private JarFile privJar = null;
public Jar(String _jarFullName)
throws IOException
{
privJar = new JarFile(_jarFullName);
}
public void dumpJar(PrintStream _out)
{
JarEntry entry = null;
Enumeration entries = privJar.entries();
while (entries.hasMoreElements())
{
entry = (JarEntry)entries.nextElement();
_out.println(entry);
}
}
public String[] getListOfFilesInDirWithinJar(String _dir)
{
String[] result = null;
JarEntry entry = null;
String name = null;
Vector tmp = new Vector();
Enumeration entries = privJar.entries();
while (entries.hasMoreElements())
{
entry = (JarEntry)entries.nextElement();
if (!entry.isDirectory())
{
name = entry.getName();
if (_dir.equals(name.substring(0, name.lastIndexOf('/') + 1)))
tmp.add(name);
}
}
if (0 < tmp.size())
{
result = new String[tmp.size()];
tmp.copyInto(result);
}
return result;
}
public static void main(String[] args)
throws Exception
{
Jar jar = new Jar("/opt/projects/java/test/lib/desert.jar");
jar.dumpJar(System.out);
System.out.println("======================");
String[] fileNames = jar.getListOfFilesInDirWithinJar("de/lc71iq72/desert/resources/html/");
int size = fileNames == null ? 0 : fileNames.length;
for (int i = 0; i < size; i++)
System.out.println(fileNames[i]);
}
}
</code>
 

Re:Help!

#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <Teeprevi.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender)
{
for (int index = 0; index < 10; ++index){
Chart1->Series[0]->AddY(100 * random(100), "", clTeeColor);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
ChartPreview(this,Chart1);
}
//---------------------------------------------------------------------------
I use Builder version 5.
I receive the message:
Error reading cbPrinters->OnChange: invalid property value
Is anybody familiair with this message?
Cees
 

{smallsort}

Re:Help!

Dennis Landi wrote:
Quote
Build
[Fatal Error] MyExe.dpr(1): Unit not found: 'System.pas' or binary
equivalents (DCU,DPU)
eww I hate it when stuff like that happens.
Check your directory paths in delphi, I had mine blown away by a
mistake in someones install, and like you I got errors falling from the
sky line rain drops in a monsoon..
--
Liz the Brit
Delphi things I have released: www.xcalibur.co.uk/DelphiThings
 

Re:Help!

Wow, this is scary. I downloaded an eval component package of a 3rd Party
vendor and ran the install program.
In Delphi 7, I now cannot run or do a syntax check on any program. I get
this error message:
<quote>
Build
[Fatal Error] MyExe.dpr(1): Unit not found: 'System.pas' or binary
equivalents (DCU,DPU)
<quote>
Now, luckily I just recorded a Ghost Image of my lap top before I went on
Holiday, just in case some such catastrophe might occur during my trip. So
when I get back home on Monday, I'll be able to restore my Ghost image.
But....
Any ideas how to fix this? Was something blown away in the registry?
I backed up my D7 Reg Key recently, too, and that's on my laptop, so I'll do
a comparison and see what i can see...
Any other suggestions appreciated...
-- d
Fastcode Project: www.fastcodeproject.org/
 

Re:Help!

I used to find dexExpress installs did a similar thing. They would wipe out
any library paths below them and so before upgrading I had to make sure all
of their paths were last in the list. However their new installer ( probably
over a year old now ) solved all these issues and more besides.
Phillip
 

Re:Help!

Quote
[Fatal Error] MyExe.dpr(1): Unit not found: 'System.pas' or binary
add ($BDS)\Lib to your library path as the first entry
 

Re:Help!

Quote
In Delphi 7, I now cannot run or do a syntax check on any program. I get
this error message:

<quote>
Build
[Fatal Error] MyExe.dpr(1): Unit not found: 'System.pas' or binary
equivalents (DCU,DPU)
<quote>
In Delphi 6, that error was shown when there were 'too many' entries in the
library path (google for it and you'll see some stuff on it). The solution
was to delete enough entries from the library path till things worked again.
That bug was fixed for D7 though, I believe. At least, I never experienced
it in D7 no matter how long my library paths got, while I ran into this
problem frequently in D6.
Perhaps it's still worth focusing on the library path and seeing if the
problem lies there.
HTH
Lauchlan M
 

Re:Help!

Quote
Any ideas how to fix this? Was something blown away in the registry?
I had this one once with the coommand-line compiler after some application's
installer had massacred my 'path' environment variable (and resulted in the
wrong dcc being called)... in the IDE, I would start by looking at the library
paths to see if they weren't corrupted.
Eric
 

Re:Help!

"Eric Grange" < XXXX@XXXXX.COM >wrote in message
Quote
>Any ideas how to fix this? Was something blown away in the registry?

I had this one once with the coommand-line compiler after some
application's
installer had massacred my 'path' environment variable (and resulted in
the
wrong dcc being called)... in the IDE, I would start by looking at the
library
paths to see if they weren't corrupted.
Thanks all.
It's got me stumped. I see nothing wrong with paths.
I will have to wait until I'm back in my office on Monday, and then I'll try
using the "Repair Installation" option of the Delphi Install; If that
doesn't work, I'll save the Registry Settings and Path settings and do a
complete Re-Install. And if that doesn't work (!), I'll restore my ghost
image.
-d
 

Re:Help!

1) Is the word "fetus" exclusive for human beings or can it be used
referring to animals? (in this particular case, a baby snake almost
perfectly formed, but still inside its egg).
2) When does an embryo become a fetus?
TIA,
Ronaldo
--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 

Re:Help!

Quote
1) Is the word "fetus" exclusive for human beings or can it be used
referring to animals? (in this particular case, a baby snake almost
perfectly formed, but still inside its egg).

2) When does an embryo become a fetus?
<q>
A fetus (or foetus, or ftus) is a developing mammal or other viviparous
vertebrate, after the embryonic stage and before birth. The plural is
fetuses or, very rarely, foeti.
</q>
en.wikipedia.org/wiki/Fetus
--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 

Re:Help!

e1 wrote:
Quote
>1) Is the word "fetus" exclusive for human beings or can it be used
>referring to animals? (in this particular case, a baby snake
>almost perfectly formed, but still inside its egg).
>
>2) When does an embryo become a fetus?
<q>
A fetus (or foetus, or ftus) is a developing mammal or other
viviparous vertebrate, after the embryonic stage and before birth.
The plural is fetuses or, very rarely, foeti. </q>

en.wikipedia.org/wiki/Fetus
Thansk! :)
--
Ronaldo
--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 

Re:Help!

Ronaldo Souza wrote:
Quote
Thansk! :)
this means something in danish, right?
--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 

Re:Help!

Kirt wrote:
Quote
Ronaldo Souza wrote:

>Thansk! :)

this means something in danish, right?

LOL!
Actually, in Danish, "Thansk" = "Dyslexic". :)
--
Rgds,
Ronaldo
--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.