How to check for a logic bomb in compiled java code ?
I have couple of security requirements.
1. How do I check for logic bomb in the compiled java code ?
2. Is there any way to monitor memory utilized by class when running inside a constructor ?
1. Let me see if you can define 'logic bomb', then maybe a answer can be supplied. If you simply mean malicious code, then in general you cannot. You can attempt to do the kinds of things that antivirus software does, like check for the existence of known malicious code and code patterns, but that won't work any better on Java than it does on anything else.
2. Google java profiling. Also, for something relatively simple, read about jconsole.
Similar Messages
-
How to check the JDK version of a compiled java file
can anybody tell me how to check the JDK version of a compiled java file ?
Edited by: gbhatia8 on Sep 9, 2010 7:04 AMThe major/minor version of the class file is the way to go.
Also, it's not necessary to write a separate program to get to those. javap prints them out when being passed the -v flag.
Note, however that "JDK version" is not a correct term, as I can create 1.4-compatible class files with a Java 6 JDK (by passing the -target flag to javac). Those won't look any different than .class files written with a 1.4 JDK. -
How to check any URL working or not through Java Code
Hi,
Is there any way by which i can check whether any particular URL is working or not using JAVA..
Thanks in advance......
AJ09Especially for POSTs, I would use HTTPClient: [http://hc.apache.org/httpclient-3.x/]
For simple GETs, you could just create the URL and then see if openStream works. -
How to check for a function module with its description and functionality
Hi all,
How to check for a function module,with its description and its functionality,in detail how can I know the purpose of a particular function module,how to search for a function module which suits my requirement .Hi,
You can search a FM of your requirement by putting in the Key words and searching for a FM. Like * KEYWORD * and then pressing F4.
Say for example you need to search something regarding converstion.
Search for * CONVERT * and press F4.
If there is something specfic like converting date to something you can give
DATE * CONVERT *
OR
CONVERT * DATE * and press F4.
Once you narrow down your search you will have a Function module documentation inside the Function module. Please note that all the FMs willl not have documentation.
Regards,
Pramod -
Want to know how to check for new line character in text file
Hi All,
I`m trying to read data from text file. However I`m not sure whether the data is in 1st line or nth line. Now I`m trying to read the text from the readline. But if text is "" and not NULL then my code fails. So I want to know how to check for new line character and go to next line to find the data. Please help.
Thanks
static int readandwriteFile(Logger logger,String filepath){
BufferedWriter out = null;
BufferedReader in = null;
File fr = null;
int get_count = 0;
try {
if(new File(filepath).exists())
fr= new File(filepath);
System.out.println("FileName: "+fr);
if(fr != null){
in = new BufferedReader(new FileReader(fr));
String text = in.readLine();
if(text != null){
get_count = Integer.parseInt(text);
in.close();
else{
get_count = 0;
else{
out = new BufferedWriter(new FileWriter(filepath));
out.write("0");
out.close();
} //Reading of the row count file ended.
catch(Exception e) {
e.printStackTrace();
finally {
try{ if (in != null) {
in.close();
if (out != null) {
out.close();
catch(Exception e) {
e.printStackTrace();
return get_count;
}You are calling the readline() only once which means you are reading only the first line from the file...
Use a loop (Do-While preferably)
do{
//your code
}while(text == "") -
How to check for the sub folder in the document library Is already Exist using CSOM?
Hi,
My requirement is to create the folder and sub folder in SharePoint document library. If already exist leave it or create the new folder and the subfolder in the Document library using client side object model
I able to check for the parent folder.
But cant able to check the subfolder in the document library.
How to check for the sub folder in the document library?
Here is the code for the folder
IsFolder alredy Exist.
private
string IsFolderExist(string InputFolderName)
string retStatus = false.ToString();
try
ClientContext context =
new ClientContext(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryLink"]));
context.Credentials =
CredentialCache.DefaultCredentials;
List list = context.Web.Lists.GetByTitle(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryName"]));
FieldCollection fields = list.Fields;
CamlQuery camlQueryForItem =
new CamlQuery();
camlQueryForItem.ViewXml =
string.Format(@"<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FileDirRef'/>
<Value Type='Text'>{0}</Value>
</Eq>
</Where>
</Query>
</View>",
@"/sites/test/hcl/"
+ InputFolderName);
Microsoft.SharePoint.Client.ListItemCollection listItems = list.GetItems(camlQueryForItem);
context.Load(listItems);
context.ExecuteQuery();
if (listItems.Count > 0)
retStatus =
true.ToString();
else
retStatus =
false.ToString();
catch (Exception ex)
retStatus =
"X02";
return retStatus;
thanks
SundharHi Sundhar,
According to your description, you might want to check the existence of sub folder in a folder of a library using Client Object Model.
Please take the code demo below for a try, it will check whether there is sub folder in a given folder:
public static void createSubFolder(string siteUrl, string libName, string folderServerRelativeUrl)
ClientContext clientContext = new ClientContext(siteUrl);
List list = clientContext.Web.Lists.GetByTitle(libName);
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml =
@"<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FSObjType' />
<Value Type='Integer'>1</Value>
</Eq>
</Where>
</Query>
</View>";
//camlQuery.FolderServerRelativeUrl = "/Lib1/folder1";
camlQuery.FolderServerRelativeUrl = folderServerRelativeUrl;
ListItemCollection items = list.GetItems(camlQuery);
clientContext.Load(items);
clientContext.ExecuteQuery();
Console.WriteLine(items.Count);
if (0 == items.Count)
//create sub folder here
Best regards
Patrick Liang
TechNet Community Support -
How to check web service (logical port) accessibility
Before call some web services, a check needs to be done to make sure the web service connection is accessible. In fact, a logical port is used; and its accessibility needs to be checked in ABAP code.
Besides calling the web service method itself and catching the exception, is there any other general way to check whether the web service connection available?
more details in respect of this question:
The executing of web services will take a relative long time while sometimes only the availability checking for web services is needed. So I'm finding other ways to check that.
In the code, the logical port will be used for accessing web services. Any way to check whether a logical port works OK in code?
Thanks!
Said
Message was edited by:
Sayid TongHi Prashant,
Thanks for your attention.
Do you mean give the web service url and check it? Neither do I know which method can be used in this regarding from program RSDEMO_HTML_VIEWER.
I'd like to give more details in respect of this question:
The executing of web services will take a relative long time while sometimes only the availability checking for web services is needed. So I'm finding other ways to check that.
In the code, the logical port will be used for accessing web services. Any way to check whether a logical port works OK in code?
Thanks.
Said -
How to check for locks on a table inside a program?
Hi Gurus,
Kindly let me know how to check for a lock on a particular table inside a program.I know that we can see locks on table held by a user from transaction SM12 but my requirement is to check for lock on MARA/MARC/MARV if lock exist then bypass my code else do the code.
Kindly suggest or give code to check for a lock on a particular table.
Thanks in advance
SudiptoFAQ. Locked.
-
How to check for updates on SCM packages?
Hey guys,
I wondered for some time now how to check for updates on SCM packages, i.e. -git
or -svn ones. Updates for binary packages are automatically updated by pacman,
no problem there. Checking for updates on non-SCM packages from the AUR is
easily done with one of the various helper tools available (personally, I use
slurpy).
However, SCM packages can change without their PKGBUILD changing, so I'm not
notified that I should recompile and update them.
Is there a "proper" way of doing this? Am I missing something?
Thanks in advance!If your system is booting then u can say that your bootblks are installed.Usually BootBlks are present in 0 & 1 slice of UFS Filesystem
/usr/platform/platform-name/lib/fs/ufs
directory where ufs boot objects reside.
An x86 FDISK partition for the Solaris software begins with a one-cylinder boot slice, which contains the partition boot program (pboot) in the first sector, the standard Solaris disk label and volume table of contents (VTOC) in the second and third sectors, and the bootblk program in the fourth and subsequent sectors. When the FDISK partition for the Solaris software is the active partition, the master boot program (mboot) reads the partition boot program in the first sector into memory and jumps to it. It in turn reads the bootblk program into memory and jumps to it. Regardless of the type of the active partition, if the drive contains multiple FDISK partitions, the user is given the opportunity to reboot another partition. -
How to check for impacts due to upgrade
We are plannining to upgrade from 4.7 to ECC6..How to check for impacts on FTP'S,shell scripts and RFC's etc due to the assesment..Please suggest
Hi,
FTP's and Shell scripts are OS dependant not SAP or Database dependant so there will be no change at all unless you upgrade OS too. RFC's are not afected as per guides, notes and my experience.
I´m doing an upgrade from 4.6C to 6.0 with connections with at least 10 systems and none of them had an issue during tests
Good luck -
How to check for bootblk on Disk
Does someone know how to check for bootblk on solaris disk.
If your system is booting then u can say that your bootblks are installed.Usually BootBlks are present in 0 & 1 slice of UFS Filesystem
/usr/platform/platform-name/lib/fs/ufs
directory where ufs boot objects reside.
An x86 FDISK partition for the Solaris software begins with a one-cylinder boot slice, which contains the partition boot program (pboot) in the first sector, the standard Solaris disk label and volume table of contents (VTOC) in the second and third sectors, and the bootblk program in the fourth and subsequent sectors. When the FDISK partition for the Solaris software is the active partition, the master boot program (mboot) reads the partition boot program in the first sector into memory and jumps to it. It in turn reads the bootblk program into memory and jumps to it. Regardless of the type of the active partition, if the drive contains multiple FDISK partitions, the user is given the opportunity to reboot another partition. -
Could someone please explain how to check for flashback, to a beginner?
Could someone please explain how to check for flashback, to a beginner? Thanks.
Install all of the available software updates. If you have flashback it will be automatically removed.
-
How can we get requester's user id using java code
Hi,
How can we get requester's user id using java code?
eg: If i had logged in as xelsysadm and request a resource for user uid101 on the userid field it should display uid101 and not xelsysadm.
also,
I have a resoure "A" which on revoking should also revoke resources B and C. How can it be done. Resource A, B, and C are 3 different resource objects.
==Thanks,
dokiOk, so there is a way, but it's not available during submission. You can use the findRequests api. From the result set, get the "Requests.Consolidated Data Value" value. In this information, you will get an xml formatted data. It provides the list of users on the request on the left side after submission. After the request is completed, this value is available. Upon completion, you could get the request information, get this value, and parse the information for user ids.
In the same adapter, use the following API:
formIntf.setObjectFormData(objInstanceKey, formHash)
The formHash is a hashtable containing the field name on your object form, and the values you wish to populate it with. You could create a textarea box on your object form and populate the userids for who the request is for.
However, this makes absolutely 0 sense. When you get a request, the list of userids are listed right there on the request.
-Kevin -
How do I pass an error status from my java code back to the Program Job Ser
How do I pass an error status from my java code back to the Program Job Server?
I have a jar program object that reports a scheduled status of "Success" even if the java code errors out.Exceptions thrown from the program object are ignored by the program job server.
You need to configure the Program Object, then stream out a special string sequence to the stdout of the Program Object, to set the scheduled instance status to Failed.
Look up SAP KBase 1201804 - How to programmatically set the status of a Program object to "Failed"
Sincerely,
Ted Ueda -
How can i return object from oracle in my java code using pl/sql procedure?
How can i return object from oracle in my java code using pl/sql procedure?
And How can i returned varios rows fron a pl/sql store procedure
please send me a example....
Thank you
nullyes, i do
But i can't run this examples...
my problem is that i want recive a object from a PL/SQL
//procedure callObject(miObj out MyObject)
in my java code
public static EmployeeObj callObject(Connection lv_con,
String pv_idEmp)
EmployeeObj ret = new EmployeeObj();
try
CallableStatement cstmt =
lv_con.prepareCall("{call admin.callObject(?)}");
cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
//registerOutParameter(int parameterIndex, int sqlType,String sql_name)
cstmt.execute();
ret = (EmployeeObj) cstmt.getObject(1);
}//try
catch (SQLException ex)
System.out.println("error SQL");
System.out.println ("\n*** SQLException caught ***\n");
while (ex != null)
System.out.println ("SQLState: " + ex.getSQLState ());
System.out.println ("Message: " + ex.getMessage ());
System.out.println ("Vendor: " + ex.getErrorCode ());
ex = ex.getNextException ();
System.out.println ("");
catch (java.lang.Exception ex)
System.out.println("error Lenguaje");
return ret;
Do you have any idea?
Maybe you are looking for
-
Populate model node with an internal table
Dear experts I have an internal table. I have a model node. I need to populate the data in my internal table onto my model node. In case of a value node, I know how to do this. I would appreciate if somebody can give me some 'code snippet' on how to
-
VIew all tables and data in MaxDB
Is there any software that is able to view all the tables and data in the MaxDB instance?
-
Jdev Design View not appropriate
My design view is not appropriate while i have just added search panel view criteria and table below it. Even for master child table things are not coming properly. Is this because of using bundles for text? Any help??? please....
-
Export script for .jpg and/or .tif
hi, i'm quite proficient with java script and action script - now also getting into scripting illustrator. i'd like to write a script to export each layer of an open document as a separate .jpg and/or .tif file. apparently though, there is no way to
-
How to download files by using ipad
How to download the pictures or files from ipad4 using safari browser,it always says it cannot be downloaded What alternative is available to solve this issue