Creating directory in java
HI all
I need to create a directory in java.I need to check whether directory is present in c:/home if its not presend then i need to create one as
.temp
how do i that ?
Thanks all for all the help.
hello all thanks for all the help
this is wat i did
private static String k_localBaseDir;
public static String getLocalBaseDir() {
if (k_localBaseDir == null) {
String home = System.getProperty("user.home");
k_localBaseDir = home + File.separator + ".temp";
} // if not set
return k_localBaseDir;
} Here in this method i get the local directory path ,this returns
c:/w2/.temp
but th eproblem is .temp directory is not created and it justs send the path thru k_localBaseDir.
Since they have already defined this method as static i cant change this one .
before returning the path i need to make sure that in that path .temp is created if its not .
ane help pls
Similar Messages
-
Creating aVirtual directory Using java
Hai ,
I am Using windows XP Operating system, I know how to create a directory using java,
can you please suggest me a procedure to create a virtual(web share ) directory using java.
waiting for your reply
Thanks & Regards,
Naga RajuVirtual Programmer is in the to share the directory
over the Internet.No, that's a file/web server. :) I see, it's a Microsoft term. -
Create scenario in Integration Directory eroor:java.lang.NullPointerExcept
Dear all,
I have create all thing under software component SAP BW 7: message interfarence and import object rfc, also create integration senario.
now while i am going to create scenario from Integration Directory > select internal communication and enter create getting error:
java.lang.NullPointerException
Internal problem occurred (INTERNAL_PROBLEM)
i have transferd Integaration scenario from IR and than try to do same, got same error,
whats the initial steps for importing Integration Repository design in to Integration Directory?
Best regards,
dushyant.Hi Dushyant,
Actually it should work...
try first this one
In ID -->First import the Integration Scenario by clicking tolls -->Transfer IS from IR
Then
Click Create Object in ID then you will get the scrren 3 0f 4.5 as per the link...
Then click create ---> and enter the service name (if does not exist it is automatically created)
Then select remaining as required...
Or else...
follow this...
Just Double click the Configuration Scenario under Configuration Objects and Proceed ( No need of Configuration Wizard required) and select your Integration scenario created in IR...
and rest you can create all the remaining steps under the Scenario that you created by following the smae steps...
Regards,
sridhar -
VMS, create directory and the chamber of secrets
Ok, here I am bumbling around in the dark. Here is the scenario I am developing an application using PL/SQL under the constraints of the SCT Banner web form system. The Banner function calls create the web page on the fly from data obtained with PL/SQL. What I would like to do is incorporate a java function into the web page. The only method available to me is via Banners function call twbkfrmt.p_printmessage (my_string); Here is the 'Plan' (caution: may be seriously flawed). I thought I could store my java code in a the CLOB field of a table, access it with a cursor and insert the code into the generated web page like so: twbkfrmt.p_printmessage (my_java_from_the_CLOB); I am having troubles loading the .js into my table. Here is how I attempted to accomplish this and the result (and to add insult to injury, it is on a VMS system!):
CREATE TABLE js_holder (
js_name varchar(30),
js_body CLOB );
CREATE DIRECTORY foos as 'USR$DISK:[CLEMENSD.SQL_EDIT]';
CREATE OR REPLACE PROCEDURE Load_CLOB IS
dest_clob CLOB;
in_file BFILE := BFILENAME('foos', 'supernote.js');
dst_offset number := 1 ;
src_offset number := 1 ;
lang_ctx number := DBMS_LOB.DEFAULT_LANG_CTX;
warning number;
BEGIN
DBMS_OUTPUT.ENABLE(100000);
INSERT INTO js_holder(js_name, js_body)
VALUES('supernote', empty_clob())
RETURNING js_body INTO dest_clob;
DBMS_LOB.OPEN(in_file, DBMS_LOB.LOB_READONLY);
DBMS_LOB.LoadCLOBFromFile(
DEST_LOB => dest_clob
, SRC_BFILE => in_file
, AMOUNT => DBMS_LOB.GETLENGTH(in_file)
, DEST_OFFSET => dst_offset
, SRC_OFFSET => src_offset
, BFILE_CSID => DBMS_LOB.DEFAULT_CSID
, LANG_CONTEXT => lang_ctx
, WARNING => warning
DBMS_LOB.CLOSE(in_file);
COMMIT;
DBMS_OUTPUT.PUT_LINE('Loaded File using DBMS_LOB.LoadCLOBFromFile.');
END;
then the following:
EOUTST> set serveroutput on
EOUTST> exec Load_CLOB
EOUTST> exec load_clob
BEGIN load_clob; END;
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 672
ORA-06512: at "BANINST1.LOAD_CLOB", line 13
ORA-06512: at line 1
EOUTST>Is the directory owned by the same schema that owns the procedure?
If not did you GRANT READ and WRITE to the proc's schema?
If so then you might want to create a simple external table to confirm that your directory and permissions are valid. -
Create directory (using RMI)
Hi all,
I would like to create a directory in the server part of a RMI application.
It appears that I don't have permission to do that...
Can anyone tell me which permissions do I need to be able to create a directory ??
My policy file is:
grant codeBase "file:/M:/project/-" {
permission java.net.SocketPermission "127.0.0.1", "accept, connect,resolve";
permission java.io.FilePermission "M:\\project\\Demo\\*", "read, write";
permission java.io.FilePermission "M:\\project\\Demo\\Playlists\\*", "read, write";
permission java.io.FilePermission "M:\\project\\Demo\\log\\*", "read, write";
permission java.io.FilePermission "M:\\project\\Demo\\Pages\\*", "read, write";
};And I would like to be able to create directory in the Page directory.
I have been told that I should allow access to read and write to all the super-directories of the Page directory... Is is true ???
Thanks for any help,
KarauHere are some standard system properties:
grant {
// "standard" properies that can be read by anyone
permission java.util.PropertyPermission "java.version", "read";
permission java.util.PropertyPermission "java.vendor", "read";
permission java.util.PropertyPermission "java.vendor.url", "read";
permission java.util.PropertyPermission "java.class.version", "read";
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "os.version", "read";
permission java.util.PropertyPermission "os.arch", "read";
permission java.util.PropertyPermission "file.separator", "read";
permission java.util.PropertyPermission "path.separator", "read";
permission java.util.PropertyPermission "line.separator", "read";
permission java.util.PropertyPermission "java.specification.version", "read";
permission java.util.PropertyPermission "java.specification.vendor", "read";
permission java.util.PropertyPermission "java.specification.name", "read";
permission java.util.PropertyPermission "java.vm.specification.version", "read";
permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
permission java.util.PropertyPermission "java.vm.specification.name", "read";
permission java.util.PropertyPermission "java.vm.version", "read";
permission java.util.PropertyPermission "java.vm.vendor", "read";
permission java.util.PropertyPermission "java.vm.name", "read";
You should know which resources your application needs to access and to provide the required permissions for them. -
New virtual Directory using JAVA
Hello Friends;
I want to create a folder under SAP j2ee engine and i want to upload my files under new folder and use it like
http://portal:port/Newfolder/mynew_photo.jpg
It is possible in iis. For ex. i can create a folder manuel under
c:\inetpub\wwwroot\new_folder
and after i put my files i can use it
http://iisserver:port/new_folder/new_photo.jpg
I have tried this directories
D:\usr\sap\p50\JC01\j2ee\cluster\server0\apps\sap.com
D:\usr\sap\p50\JC01\j2ee\cluster\server0\apps\
D:\usr\sap\p50\JC01\j2ee\cluster\server0\
and i have create new folder but i couldnt use it.
I hope that i have explained my question.
Thanks in Advance
Best RegardsDear Eray,
You can use the following Java code to create the Folder (Directory) in the SAP J2EE Engine and add the contents in the Directory
import java.io.*;
class CreateDirectory
public static void main(String args[])
try{
String strDirectoy ="test";
String strManyDirectories="dir1/dir2/dir3";
// Create one directory
boolean success = (new File(strDirectoy)).mkdir();
if (success) {
System.out.println("Directory: " + strDirectoy + " created");
// Create multiple directories
success = (new File(strManyDirectories)).mkdirs();
if (success) {
System.out.println("Directories: " + strManyDirectories + " created");
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
Rewards Points if useful..
Regards,
N.Jayanth Kumar -
How to save report in PersonalCategory after creating it using java panel?
Hi,
Anybody knows How to save report in PersonalCategory after creating it using java panel?
I dont want to save it in public folder. I want to save report (webi) in user's personal category.
can anybody send me source code?
It will help me a lot.
Thanks in advance
Amol MaliHi teda,
i'm assuming that you have seen my post that i did successfuly save report in user's personal category.
Actually the report is created in webi java panel using RE SDK and is saved in Report Sample Folder then i'm saving it in user's personal category by following code
string query = "Select SI_PERSONAL_CATEGORIES From CI_INFOOBJECTS Where "
+ "SI_INSTANCE=0 And SI_ID=" + reportID;
InfoObjects infoObjects = infoStore.Query(query);
InfoObject infoObject = infoObjects[1];
Webi wreport = (Webi)infoObject;
ObjectRelativeIDs personalIDs = wreport.PersonalCategories;
/personalIDs.Add(Convert.ToInt32(categoryID));
infoStore.Commit(infoObjects);
But the report is presents in the Folder also and in user's personal category also.
I dont want the report to be in the folder (Report Sample) if i saved it in user's personal category.
How can i do that?
any idea.
Please help me.
Thanks in advance
Amol Mali
Edited by: amol mali on Jan 9, 2009 7:55 PM -
Help with creating an animated java applet...
Hello, everyone! I'm working on a homework assignment for my Intro to Java class, and I'm having a problem I've never run into before. My assignment is to create a animated Java applet which displays an image of an alien spaceship which travels in diagonal lines across the applet area. My main problem is that when I try to compile my code, I get three "cannot find symbol" errors about my variable "alien." I can't figure out why declaring it as a class variable hasn't solved my problem. The errors pop up for the repaint() method, as well as the pane.add and the paintIcon. Here's my code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.Timer;
class DrawAlien extends JPanel
public class Alien extends JApplet implements ActionListener
ImageIcon alien;
public void init()
Container pane = getContentPane();
alien = new ImageIcon(getClass().getResource("alien.gif"));
pane.setBackground(Color.black);
pane.add(alien);
Timer timer = new Timer(30, this);
timer.start();
public void actionPerformed(ActionEvent e)
alien.repaint();
}I've only posted the section which I think is relevant to my problem, but I can post the rest if anyone thinks it's necessary.
I'm aware that the code isn't ready yet in several other ways, but I don't think I can move on until I figure out what's up with the "alien" variable. I don't need anyone to write code for me or anything like that, I just lack perspective here. A couple hints in the right direction would be invaluable. Thanks!
Edited by: springer on Nov 25, 2007 10:46 PMYou can?t add ImageIcon into pane, you can do like below.
alien = new ImageIcon(getClass().getResource("alien.gif"));
pane.setBackground(Color.black);
JLabel label = new JLabel(alien);
pane.add(label); -
Error 7 occurred at Create Folder in Create Directory Recursive.vi-
Recieved following message when attemoting to create source distribution
Error 7 occurred at Create Folder in Create Directory Recursive.vi->ABAPI Dist Create Directory Recursive.vi->ABAPI Dist Chk for Destinations.vi->ABAPI Copy Files and Apply Settings.vi->SDBEP_Invoke_Build_Engine.vi->SDBUIP_Build_Invoke.vi->SDBUIP_Build_Rule_Editor.vi->SDBUIP_Item_OnDoProperties.vi->SDBUIP_Item_OnDoProperties.vi.ProxyCaller
Possible reason(s):
LabVIEW: File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux.Hello,
Could you please list which options you are selecting when building a
source distribution (I am assuming you are using LabVIEW 8.0?).
Do you get this error when clicking on "Generate Preview" button when configuring source distribution properties?
Under "Distribution Settings" category, could you try checking the
"Disconnect type definitions and remove unuses polymorphic VI
instances" option and see if that helps with the build process?
Also I suggest Mass Compiling your VIs (Tools -> Advanced -> Mass Compile) before creating a source distribution.
If these do not help, could you attach your project with all the VIs it contains here?
Thank you and best regards,
Shakhina P.
Applications Engineer
National Instruments -
Hi
Is there a dictonary view where i can find all the "virtual directory" which are created with the "create directory" command ??
Thanks.ah.. :)
So I should add, that in general those view names are "plurals" (ending with an S), e.g. dba | all | user _ objects, tables, tab_columns, indexes, synonyms, triggers, sequences, users, and so on.
(And the v$ dynamic/stats view names are often in singular, like v$metric, process, session, datafile, tablespace - but this "rule" seem to be deteriorating with new views added). -
Can not create directory error while creating database
i am creating database using dbca in oel but when i try to do so i get an error saying can not create directory pawii
and pawii is the sid
actually oracle is installed on u01 and i am creating database in u02
but this error is not allowing me to create database but when i try to create database in uo1 the database installed successfully but this is not happening when i try to create database in another mount point u02987018 wrote:
so finally i had solved the problem myself as people like rukbat are very unhelpful in nature here
all we had to do is we had to change the group of the folder to oracle and oinstall where we are going to create our new database :)Actually he tries to be quite helpful. But sometimes the help you need isn't the help you want.
"When you need me but do not want me, then I must stay. When you want me but no longer need me, then I have to go." (Nanny McPhee) -
Geting error while creating a dir through CREATE DIRECTORY command
Hi Gurus,
When I'm trying to create a dir through this command with logged in as SYS
CREATE DIRECTORY pump_dir AS 'd:\temp\pump_dir';
I'm getting the error
Error starting at line 1 in command:
CREATE DIRECTORY pump_dir AS 'd:\temp\pump_dir'
Error at Command Line:1 Column:18
Error report:
SQL Error: ORA-00955: name is already used by an existing object
00955. 00000 - "name is already used by an existing object"
Any ideas how I can create a dir and grant access to a different user.
Thanks
Amitava.amitavachatterjee1975 wrote:
I checked and there is no such directory. I guess it is not that simple, the error I mean.Actually it is , please see,
ORA-00955: name is already used by an existing object
Cause: An attempt was made to create a database object (such as a table, view, cluster, index, or synonym) that already exists. A user's database objects must have distinct names.
Action: Enter a unique name for the database object or modify or drop the existing object so it can be reusedSo as Sb mentioned, check that which object is using the same name that you are trying to assign to this directory object and either rename or drop the object if you want to use the same name only. If not, you can always use another distinct name for this directory object .
Aman.... -
Hi, I have been having problems with Internet Explorer 8 using Windows 7 so wanted to install Firefox but unable to as get a message saying error creating directory c:\programme files (x86)\mozilla firefox\searchplugins
Thank you guig2! Followed your bleepingcomputer.com link above and found the problem was my permissions on C:\Users\Bill\AppData\Local/Temp. It was not "Full Control" for my User or Administrator. Updated the two lines to permit full control for folder, subfolder and files. Ran perfect.
-
Burrito install fail, trying to create directory in wrong place
Below is the error log from my attempted install. Of the 23 errors 22 are being unable to deleted things it never created. The error that seems to be the initial cause is this:
Unable to create directory "\\drnas02\users\CADU\gae04\..\Adobe Flash Builder Burrito Preview
\\drnas02\users\CADU\gae04 is a home directory I have on a network drive, but the installer isn't trying to create the directory there, it is trying to put it one dir up (with the ..) where I don't even have read permissions. I never specified the gae04 directory to the installer, but I assume its defined as some sort of application data directory as one other app created a directory there.
Here is the full error log.
Exit Code: 7
-------------------------------------- Summary --------------------------------------
- 0 fatal error(s), 23 error(s), 0 warning(s)
ERROR: 16101 Unable to create directory "\\drnas02\users\CADU\gae04\..\Adobe Flash Builder Burrito Preview
ERROR: 16101 Command ARKCreateDirectoryCommand failed.
ERROR: 16101 Unable to delete directory "\\drnas02\users\CADU\gae04\..\Adobe Flash Builder Burrito Preview". Error 2 The system cannot find the file specified.
ERROR: 16101 Error rolling back command ARKCreateDirectoryCommand
ERROR: 16098 Unable to delete file copy at "C:\Program Files\Adobe\Adobe Flash Builder Burrito\eclipse\configuration\config.ini" Error 3 The system cannot find the path specified.
ERROR: 16098 Error rolling back command ARKMoveFileCommand
ERROR: 16097 Unable to delete directory "C:\Program Files\Adobe\Adobe Flash Builder Burrito\eclipse\configuration". Error 2 The system cannot find the file specified.
ERROR: 16097 Error rolling back command ARKCreateDirectoryCommand
ERROR: 16035 Unable to delete file copy at "C:\Program Files\Adobe\Adobe Flash Builder Burrito\AMT\application.xml" Error 3 The system cannot find the path specified.
ERROR: 16035 Error rolling back command ARKMoveFileCommand
ERROR: 16034 Unable to delete file copy at "C:\Program Files\Adobe\Adobe Flash Builder Burrito\AMT\application.sif" Error 3 The system cannot find the path specified.
ERROR: 16034 Error rolling back command ARKMoveFileCommand
ERROR: 16033 Unable to delete directory "C:\Program Files\Adobe\Adobe Flash Builder Burrito\AMT". Error 2 The system cannot find the file specified.
ERROR: 16033 Error rolling back command ARKCreateDirectoryCommand
ERROR: 21 Deleting Registry Key - failure. Error 5
ERROR: 3 Unable to delete file copy at "C:\Program Files\Adobe\Adobe Flash Builder Burrito\FlashBuilder.exe" Error 3 The system cannot find the path specified.
ERROR: 3 Error rolling back command ARKMoveFileCommand
ERROR: 2 Unable to delete file copy at "C:\Program Files\Adobe\Adobe Flash Builder Burrito\.eclipseproduct" Error 3 The system cannot find the path specified.
ERROR: 2 Error rolling back command ARKMoveFileCommand
ERROR: 1 Unable to delete directory "C:\Program Files\Adobe\Adobe Flash Builder Burrito". Error 2 The system cannot find the file specified.
ERROR: 1 Error rolling back command ARKCreateDirectoryCommand
ERROR: The following payload errors were found during install:
ERROR: - Adobe Flash Builder: Install failedIndeed, our core installer team has agreed to supply the home folder path token we need for this fix, in time for the Burrito release.
I experimented with changing my own network Documents location a few months ago, and was able to move it down one level without much difficulty. The actual steps vary a little depending on whether you're on WinXP, Vista or Win7:
WinXP:
http://support.microsoft.com/kb/310147
Win7:
http://social.answers.microsoft.com/Forums/en-US/w7files/thread/fd508c30-7dad-4a7e-a652-ba 49828e5f0e
-Chris -
Backup failed with Error: (-50) Creating Directory
Repeats ad nauseum.
This is backing up to a second internal drive that is an exact duplicate (in terms of HD model and size).
Does anyone know what Error -50 means? Lack of permissions? Invalid name (doesn't seem like it)?
8/30/08 9:06:37 AM /System/Library/CoreServices/backupd Starting standard backup
8/30/08 9:06:37 AM /System/Library/CoreServices/backupd Backing up to: /Volumes/Sliffy Time/Backups.backupdb
8/30/08 9:06:58 AM /System/Library/CoreServices/backupd Error: (-50) Creating directory 2008-08-30-090658.inProgress
8/30/08 9:06:58 AM /System/Library/CoreServices/backupd Failed to make snapshot container.
8/30/08 9:07:03 AM /System/Library/CoreServices/backupd Backup failed with error: 2Hi Glenn,
Thanks for the suggestion. Nope, it's not listed. The only thing listed is my Time Machine volume.
After a reboot, Time Machine seems to be working. It's making backups on schedule and the logs look good, not reporting any strangeness.
A bit bummed about these phantom errors that go away on reboot. I'll keep on eye on the error/reboot frequency.
Rob
Maybe you are looking for
-
How can I get all of my notes backed up to iCloud?
I have many notes on my iPhone that fail to show up in iCloud. I'm trying to figure out how to move all of these and save them, because they are important. I'm running the latest version of iPhone (7.1.1) and Mac(10.9.3) software. My notes from this
-
HT4974 How can I select a remote volume (NAS) as my service data storage volume?
Hi everyone, I have been struggling with the following: I have Mac OS X Server (the Mountain Lion add-on) running on a Mac Mini (2009). Ever since the upgrade to Mountain Lion Server (10.8.2) I have been wanting to store the Service Data on my Synolo
-
I was LIED to regarding a SERVICE UPGRADE. UNBELIEVABLY disappointing and dishonest
I have been a loyal verizon customer for over a year. Was excited to have my new service installed at my new place. $106 a month including DVR. Very pleased. I could not view my bill or change services within the first month but wanted to look into
-
Why does my lightening wire not fit the ipod nano 7th gen
Could someone tell me why does my lightening wire now not fit the ipod nano (7th gen)? I push it in but it seems to spring out and not fully connect. I only bought it 1 year ago and it is been great, but now I think it needs to go in the bin
-
Hi, When would a switch from ECS to Classic be justifiable? Thanks.