Get all directories...
I am trying to get this code to work, but i a returning some errors that i can't get rid of.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class Search extends JFrame {
public static void main(String[] args) {
new Search();
JLabel filename;
public static JTextField txt=null;
JButton button;
public static JTextArea txtarea = null;
JLabel lbl;
Search() {
JPanel panel= new JPanel();
setContentPane(panel);
filename =new JLabel("Enter file name:");
txt=new JTextField(30);
button= new JButton("Search");
txtarea=new JTextArea(25,250);
//lbl=new JLabel();
txtarea.setEditable(false);
button.addMouseListener(new MListener());
panel.add(filename);
panel.add(txt);
panel.add(button);
panel.add(txtarea);
//panel.add(lbl);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(500,500);
setVisible(true);
class MListener extends MouseAdapter
public void mousePressed(MouseEvent evt)
searchcomp(txt.getText()); //<-- Error: can't find simble
public void searchcomp(String file)
File[] drives=File.listRoots();
for (int ctr=0;ctr<(drives.length-1);ctr++)
search2(drives[ctr],file);
public void search2(File dir,String file)
File[] directories=dir.listFiles();
for(int ctr=0;ctr<directories.length;ctr++)
if(directories[ctr].isDirectory())
if(directories[ctr].listFiles()!=null)
search2(directories[ctr],file);
else
if(directories[ctr].getName().equals(file))
//lbl.setText(directories[ctr].getAbsolutePath());
txtarea.append(directories[ctr].getAbsolutePath()+"\n"); //<-- Error: can't find simble
This program returns all the directorys of a computer
Thanks in advance
-Ron
Edited by: RonX on Dec 26, 2007 9:53 PM
RonX wrote:
Dear jverd,
Next time paste in the exact, complete error message, and clearly indicate which line it's occurring on, rather than just paraphrasing and misspelling it.It is clearly written in the code it's self, see the green comments to the right of the code! maybe you should open your eyes next time!No need to shout.
I know what's there. I saw it before I posted previously. It is neither complete nor exact. It is a misspelled paraphrasing. It would have been clearer if you had pasted in the exact, complete error message, as I suggested, separately from the code, and also clearly indicate in the code where it occurred.
Similar Messages
-
Ho to get all directories by computer name.
I have a computer name (e.g \\NT_SERVER) how can i get a list of all the directories of this computer??
A classic one ...
http://forum.java.sun.com/thread.jspa?threadID=202103&tstart=75 -
FM to get list of all directories and files on application server..
Hi All,
Can anyone tel me FM to get list of all directories and files on application server..i know 'F4_DXFILENAME_TOPRECURSION'
and '/SAPDMC/LSM_F4_SERVER_FILE' these are working too...but my requirement is when i click F4 i should get list of directories and whn i select one of these the only directory name should display.....and whn click again for 2nd text box field i want file name ...means directory name in one text box field and file name in another....plz help me out..
helpful answers wil b awarded.
Thanks,
JayshreeHi Jayashree
Please check this FM, SUBST_GET_FILE_LIST. Pass the file path and file name, if it returns an entry in table FILE_LIST, then the filename and path are valid.
Hope this helps !
~ Ranganath -
Getting all types of files with the help of get_file_name function
hi all,
i am using Forms [32 Bit] Version 6.0.8.24.1 (Production).
i have used get_file_name function to the file name of all type of files
but i am able to get only the folders when i tried like below
:FILE_NAME := GET_FILE_NAME(NULL,NULL,NULL,'Choose a Directory',OPEN_FILE,FALSE);my requirement to get all types of files on the window(user will selects whichever way he wants)
Can i acheive it through get_file_name or i have to go for any alternative to get the file list, so that user can select by browsing the folders.
Please help.
Thanks..hi,
in my code the select file was set to false(so showing only the directories) now i have set it to 'true'. its showing the files now.
with the help of my above shown code i can get the full path of the file.
is there any way to get only the file name?(other than the last occurance of '/' logic or that is only the way?)
Please help.
Thanks.. -
FileSelectPopup in LW/CVI not listing all directories/files in linux.
This is concerning a port of Windows based software to Linux. The FileSelectPopup dialog does not list all the files and folders in the current directory. For example, if I look in /home/pshrewsberry I can see everything but when look in /home I cannot see pshrewsberry! Another example: If I am in a directory "test" which contains directories A,B,C and D only B and D are listed. The same happens with files as well: In the FileDialogTest directory that I have attached to this post when I browse this directory using FileSelectPopup I can't see the cvibuild.FileDialogTest directory (created after building) nor can I see the binary "FileDialogTest".
This problem does not happen in all directories that I browse through either. I can't seem to find a rhyme or reason to it. File permissions on all files in FileDialogTest (for example) are the same and UID and GID are same as well but the FileDialogTest binary and the cvibuild.FileDialogTest directory are not listed. If I run as root I get the same results.
I have tested this in Linux with LW/CVI8 and the LW/CVI 2010 beta and I get the same erroneous results with both.
Could this be a bug in LW/CVI for linux?
Thanks
-pete
Attachments:
FileDialogTest.tgz 4 KBI'm not sure how to track a corrective action request.
What is the timeframe for this to make it into a beta or a distro. I just went throught this before concerning another problem that I found. We ultimately received an updated shared object file (*.so) to fix the issue before the ultimate release of fix in beta. That resolution is preferable for this issue as opposed to waiting for the next official update.
Thanks,
-pete -
Traversing all directories and listing all file objects
Hi
I am wondering if someone can help me out.
In IFS, I would like to traverse recursively down all directories starting from a particular directory to be set by me, and collect all objects that are file objects, say in an Array of PublicObjects. However the listing should exclude folder objects. Obviously the folder objects would be used to traverse further down the directory tree and collect more (file) PublicObjects.
I have tried a few things but I can't seem to distinguish between folder and file objects. If someone could provide me with a code example to get me started that would be tremendously appreciated.
Thanks very much.
HugoCan you not just test for an instance of Folder?
-
Dear All
Getting All Oracle Instances SIDs
How can we get It
Thanx In advanceFor Database Created with DBCA, $ORACLE_BASE/admin typically has directories for all of the databases. The directory name is typically the sid.
ORACLE_HOME/network/admin/listner.ora or lsnrctl status
Linux/unix
The oratab file, ps -ef | grep pmon
Windows:
The Services control will list the Oracle processes. The database process has the SID in the name. You can also use the Administration Assistant for Windows. -
Apache not listing all directories
Hi,
I am trying to transfer my LAMP application from Ubuntu to ArchLinux. Everything is fine in Ubuntu, but when I look at my page in Arch, some of the functions are missing. I installed firebug, and realized that users' pictures cannot be found, since they were in user_pic directory. I tried to look at the directory listing of my public html directory and realized that some of the directories are missing. I set the permission to 777 and 644 for all directories, but still unable to see them.
At first, I thought user_pic directory is missing, because of the "_" in it, but I found another directory containing "_". Also, I observed that some directories that don't have "_" in their names are missing as well. Any idea how I can get rid of this problem?
Edit: I just copied the entire directory content to /srv/http/ and was able to see everything correctly. Any idea why it doesn't work in my home directory at http://localhost/~myname/ ?
Thanks
Last edited by mohtasham1983 (2008-12-25 07:45:32)dav7 wrote:I don't think Arch configures its httpd to list user directories by default.
It doesn't list if there is index.html in the directory. I don't have index.html, so it shows all files. I added index.php to the confi file, so that when apache sees it, doesn't list the directories. But this is not my concern. My main problem is that apache cannot see some of the directories in user home directories at all. It's very strange.
Also, I don't know why in Arch they have set the default debug mode of apache to false, so that people can't see error messages. My php file has several syntax errors, but I can't see the error message on the browser. I tried php -l to see the error, but it just says cannot parse the document without indicating the actual error and when it occurs. Still looking for enabling error messages in apache. -
Can't seem to get all the bookmark folders in alfabetical order
I have tried just about everything to get my bookmark folders in to alphabetical order most are right but at the bottom of the list there are quit a few folders that are not. I have tried the organize bookmark command than the view than sort than by name but it just wont do it.
I can't get all of my bookmarks in alphabetical order either and I find it utterly preposterous that something as simple as organizing bookmarks turns into a cumbersome search over the internet.
What is maddening is that there is something in Firefox that will alphabetize your bookmarks, but only in half-ass fashion leaving you to scratch your head and ask the question, "what were they thinking?"
What I mean by half-ass is that when I go to "Organize Bookmarks..." highlight the bookmarks menu and then select Views-->Sort-->By name I find that the book marks are not in order after I am done. Why have these buttons if they clearly will not work. I plan to video tape this and put it on YouTube to expose the utter stupidity in something that ought to be trivial.
Has anyone ever considered the case where a user has so many bookmarks that they NEED to be in alphabetical order?
Every computer on the planet organizes ALL files and ALL directories in order. So, tell me, where is the logic in the way Firefox organizes their bookmarks (seems to be chronological)? Chronological might be okay for a small number of bookmarks (like five or so) or recently bookmarked pages, but I have hundreds of bookmarks!
There's a reason why we alphabetize things. How does one find a book in a library?
In Firefox I have organized bookmarks in a directory (and I think this might even work), but this still doesn't address the issue I have with needing to have EVERY file and EVERY folder in ALPHABETICAL order! WTF? This is just idiocy. -
How get all sAMAccountName from LDAP?
Good day ... i'm find this ...
declare
-- Adjust as necessary.
l_ldap_host VARCHAR2(256) := &&;
l_ldap_port VARCHAR2(256) := &&;
l_ldap_user VARCHAR2(256) := &&;
l_ldap_passwd VARCHAR2(256) := &&;
l_ldap_base VARCHAR2(256) := 'dc=&&,dc=&&,dc=&&';
l_filter varchar2(100) := '(&(sAMAccountName=*))';
l_retval pls_integer;
l_session dbms_ldap.session;
l_attrs dbms_ldap.string_collection;
l_message dbms_ldap.message;
l_entry dbms_ldap.message;
l_attr_name varchar2(256);
l_ber_element dbms_ldap.ber_element;
l_vals dbms_ldap.string_collection;
l_raw dbms_ldap.binval_collection;
l_result varchar2(100);
begin
-- Choose to raise exceptions.
dbms_ldap.use_exception := true;
dbms_ldap.utf8_conversion := false;
-- Connect to the LDAP server.
l_session := dbms_ldap.init(hostname => l_ldap_host, portnum => l_ldap_port);
l_retval := dbms_ldap.simple_bind_s(ld => l_session, dn => l_ldap_user, passwd => l_ldap_passwd);
-- Get all attributes
l_attrs(1) := 'sAMAccountName'; -- retrieve all attributes
l_retval := dbms_ldap.search_s(ld => l_session
,base => l_ldap_base
,scope => dbms_ldap.scope_subtree
,filter => l_filter
,attrs => l_attrs
,attronly => 0
,res => l_message);
if dbms_ldap.count_entries(ld => l_session, msg => l_message) > 0
then
-- Get all the entries returned by our search.
l_entry := dbms_ldap.first_entry(ld => l_session, msg => l_message);
<<entry_loop>>
while l_entry is not null
loop
-- Get all the attributes for this entry.
dbms_output.put_line('---------------------------------------');
l_attr_name := dbms_ldap.first_attribute(ld => l_session
,ldapentry => l_entry
,ber_elem => l_ber_element);
<<attributes_loop>>
while l_attr_name is not null
loop
-- Get all the values for this attribute.
l_vals := dbms_ldap.get_values(ld => l_session, ldapentry => l_entry, attr => l_attr_name);
<<values_loop>>
for i in l_vals.first .. l_vals.last
loop
dbms_output.put_line('ATTIBUTE_NAME: ' || l_attr_name || ' = ' || substr(l_vals(i), 1, 200));
end loop values_loop;
l_attr_name := dbms_ldap.next_attribute(ld => l_session
,ldapentry => l_entry
,ber_elem => l_ber_element);
end loop attibutes_loop;
l_entry := dbms_ldap.next_entry(ld => l_session, msg => l_entry);
end loop entry_loop;
end if;
-- Disconnect from the LDAP server.
l_retval := dbms_ldap.unbind_s(ld => l_session);
dbms_output.put_line('L_RETVAL: ' || l_retval);
end;
If i use filter '(&(sAMAccountName=*))' (me need get all 'sAMAccountName')
ERROR at line 1:
ORA-31202: DBMS_LDAP: LDAP client/server error: Sizelimit exceeded
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_LDAP", line 1457
ORA-06512: at "SYS.DBMS_LDAP", line 234
ORA-06512: at line 28
How fix it ?
Thanks all.
p.s. I'm beginner Developer Oracle 10gProbably some workaround needed. Hopefully this one works: http://www.freelists.org/archives/oracle-l/04-2006/msg01100.html
-
"get all new data request by request" after compressing source Cube
Hi
I need to transfer data from one Infocube to another and use the Delta request by request.
I have tried this when data on Source Infocube was not compressed and it worked.
Afterwards some requests were compressed and after that the delta request by request is transfering all the information to target Infocube in only one request.
Do you know if this a normal behavior?
Thanks in advanceHi
The objective of compression is it will delete all the request in your F table and moves data to E table.after compression you don't have request by request by data.
This is the reason you are getting all the data in single request.
Get data request by request works, if you don't compress the data in your Cube.
If you want to know about compression, check the below one
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c035d300-b477-2d10-0c92-f858f7f1b575?QuickLink=index&overridelayout=true
Regards,
Venkatesh. -
'Get All New Data Request by Request' option not working Between DSO n Cube
Hi BI's..
Could anyone please tell me why the option ' Get one Request only' and 'Get All New Data Request by Request' is not working in DTP between Standard DSO and InfoCube.
Scenario:
I have done the data load by Yearwise say FY 2000 to FY 2009 in Infopackage and load it to Write-optimised DSO (10 requests) and again load Request by request to Standard DSO and activate each request. I have selected the option in DTP's to 'Get All New Data Request by Request' and its working fine between WDSO and SDSO. But not working between Cube and SDSO. While Execute DTP its taking as a single request from SDSO to Cube.( 10 request to single request).
Regards,
Sari.Hi,
How does your DTP setting looks like from below options ? It should be change log, assuming you are not deleting change log data.
Delta Init. Extraction from...
- Active Table (with archive)
- Active Table (without archive)
- Archive ( full extraction only)
- Change Log
Also if you want to enable deltas, please do not delete change log. That could create issue while further update from DSO.
Hope that helps.
Regards
Mr Kapadia
*Assigning points is the way to say thanks* -
Hi guys,
I am developing an integration with EWS based on php. I am using a library I found https://github.com/jamesiarmes/php-ews
In my case users have various calendars hanging from the root, I get access to the default calendar by this:
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
$response = $ews->FindFolder($request);
I also get access to shared calendars by this:
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::PUBLIC_FOLDERS_ROOT;
$response = $ews->FindFolder($request);
But I am getting crazy to get all calendars hanging from the root. If I asked for all folders on the root I don't get those calendars. What service and params do I need to send to get all calendars from the root?
Thanks!!If you make a FindFolder Request set the Traversal to Deep and use a restriction on the FolderClass to IPF.Appointment that should return all the Calendar folders in a mailbox eg
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
soap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindFolder Traversal="Deep">
<m:FolderShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:FolderShape>
<m:IndexedPageFolderView MaxEntriesReturned="1000" Offset="0" BasePoint=
"Beginning" />
<m:Restriction>
<t:IsEqualTo>
<t:FieldURI FieldURI="folder:FolderClass" />
<t:FieldURIOrConstant>
<t:Constant Value="IPF.Appointment" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="msgfolderroot" />
</m:ParentFolderIds>
</m:FindFolder>
</soap:Body>
</soap:Envelope>
Cheers
Glen -
How can i get all values from jtable with out selecting?
i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
thanks in advance.
rajaYou could set the table's data model to be the same:
output2.setModel( output1.getModel() ); -
Get All Values From NewForm.aspx using Event Receiver Item Adding
HI All,
I have conditions to check before the insertion of "Calendar Event".For this I am using Item Adding Event Receiver ,When Click on Save button I need to get all the values of Items filled in NewForm.aspx and check
the condition,If condition satisfies make them insert else show alert info as"Not Valid",Below is code and error message
public override void ItemAdding(SPItemEventProperties properties)
base.ItemAdding(properties);
string StartTime = properties.AfterProperties["Start Time"].ToString();
string EndTime = properties.AfterProperties["End Time"].ToString();
Error
Object reference not set to an instance of an object.
Use the New "Keyword to create an object instance
Can any one help me how can I do it.
Thanks,
Quality Communication Provides
Quality Work.
http://siddiq-sharepoint2010.blogspot.in/
Siddiqali Mohammad .Hi,
Have you tried with the code snippet as mentioned below
string EndDate = Convert.ToString(properties.AfterProperties["EndDate"]);
string StartDate = Convert.ToString(properties.AfterProperties["EventDate"]);
If my post is helpful - please click on the green arrow to mark it as answer
Maybe you are looking for
-
I also get the same thing when I try to open my mail. Any help would be great! I'm on the latest Mac Mini so I don't have a disk drive. And no, I didn't have a Time Machine backup but I do have all of my files backed up online with Mozy.
-
How to create a Tree of elements in javascript in the jsp page or it may be a servlet.. the content should be taken from the database. There is any passibilities stright away in the Explorer. Message was edited by: parthibankannan
-
I never deleted the videos. so where are they
so i sold my ipod then when i want to watch my tv show i downloaded, they weren't there. now i never deleted them, im 100% sure. and the space on my hard drive is still getting taken up. in my tv show folder it only shows the shows i've already downl
-
Changing video file that is on the Stage
Hello, So, I need to replace the video that is already on the stage in the layer called 'video' I need to do that to keep the settings I put on it (pause/play etc... on the timeline) I tried that, but it doesn't work, because it add another video so
-
How do i install programs that I've previosly deinstalled?
Hey, first of I've got a few problems. I installed the Adobe cc free trial a few weeks before. Yesterday I've paid for the Creative Cloud. But when I started the program it wanted a serial number. Since I didn't get one in the first place, I tried fi