Folder object throws IllegalStateException
I am writing an email program which fetches the mail from Gmail. I have written the below mentioned code to fetch the name of all the folders of a particular client. when the servlet is loaded on the server, after that on the first (on servlet) the code marked (1) and (2) works fine, i.e the Folder object is created but on the subsequent hits, the folder object is not created. It throws an exception:
java.lang.illegalStateException:not connected
Why I am not been able to get the Folder object on subsequent hits?
public ArrayList getCustomFolders(double pin){
System.out.println("Getting the name of all folders...");
String username=(String)username_pin.get(pin);
HashMap mapmap=(HashMap)map.get(username);
Store store=(Store)mapmap.get("store");
ArrayList folders=new ArrayList();
try {
Folder folder=store.getDefaultFolder();---------------(1)
Folder f[]=folder.list();-------------------------------------(2)
System.out.print("Folder: ");-------------------//this line is not printed after he first hit.
for(Folder f1:f){
String foldername=f1.getFullName();
System.out.print(foldername+", ");
folders.add(foldername);
if(f1.HOLDS_FOLDERS!=0){
Folder subfolders[]=f1.list();
for(Folder sub:subfolders){
System.out.print(sub.getFullName()+" ,");
folders.add(sub.getFullName());
} catch (MessagingException e) {
System.out.println("Exception caught while fetching the list of folders");
}catch(Exception e){
System.out.println("Exception caught"+e);
return folders;
}Edited by: carox on Mar 23, 2010 2:55 AM
Edited by: carox on Mar 23, 2010 3:05 AM
Edited by: carox on Mar 23, 2010 3:06 AM
Edited by: carox on Mar 23, 2010 3:07 AM
Because the Store has been closed. Why was it closed? I don't know. I can't see enough of your
application to tell, but I'm sure you can figure it out. Note that if you leave it open for a long time
without using it, the server will close it.
Also, note that this code isn't doing what you expect:
if(f1.HOLDS_FOLDERS!=0){
What you meant was:
if ((f1.getType() & Folder.HOLDS_FOLDERS) != 0) {
Similar Messages
-
Encryption of folder object in J2ME
hello, is there an API that i can use to encrypt/decrypt the folder object (not the files inside the folder) using J2ME (currently using bouncycastle)?
prasad_at_sun wrote:
Thanks for your reply. In my case we have the application server setup at client side only (third party is testing our application and according to their need we have to handover the things in their hands) where i am deploying jar/war files. I am still without solution..What don't you understand about "You can't do it." ?
It's very simple really - whatever the language it makes no sense to encrypt the 'code' since to execute the code the execution engine needs to decrypt the 'code' before it can execute it so it has to have access to the decryption key. If the execution engine has access to the key so does anyone who has access to the execution engine. -
Creating a shortcut link to a public folder object. Is it possible?
I have never done this before and never had a reason to until now. I am wondering if there is a way to have a link to a Public Folder object such as an email with attachments sent to users that have Outlook 2010. The reason I am doing this is because we
send out daily emails with attachments to all users and since Exchange 2010 no longer supports single instance storage, these emails are consuming too much database space. I want the department sending these emails to just send a single copy to a public folder
and then send a link to that email to all users. Is this even possible?Hi,
From my research, from Exchange 2007 and later version, the url to access public folder is no longer simple and clear as it in Exchange 2003. The hyperlink is long and complicated with a series of number and letter in the end.
http://technet.microsoft.com/en-us/library/bb397221(v=exchg.141).aspx#Access
I’d recommend you put files on a shared platform for long-term.
Regards,
Rebecca Tu
TechNet Community Support -
Uninstallation via SCCM leaves behind "folder object"
Hi
I know this isn't specifically sccm related but it does happen via sccm.
I am upgrading some client software from an older version to the newest.
on a lot of machines I am seeing the following..
1. the application uninstalls the old software
2. somehow the process leaves behind the folder object.. by this I mean... the uninstaller actually removes the folder BUT somehow windows still thinks the folder is there.. all security settings etc. are wiped and there's no way to access the folder.. with
ANY account.
This means the new msi installation fails because it cannot access/create the same folder to install..
3. after a reboot the folder object is gone and the installation works perfectly..
Has anyone seen this kind of behaviour? and what can I do about it?
Kindest regards, MartinHi Gerry..
I know.. but since sccm guys(!!) often also work with msi deployment/package deployment I was hoping this would be a good place to ask :-)
There is no additional switch missing.. I actually spoke to the developer and he was at a loss as to what was happening.. This is a program I have installed and updated many many times.. each time I use the same switches and each time everything works fine..
Torsten... I determine it by rebooting.. and the folder is then gone..
somehow the folder-object is getting completely locked down.. I can see the folder but NO WAY access it.. as domain admin I do not have access to view security page, nor can I take ownership, delete it, open it, or anything else.
Kindest regards, Martin -
Response.getWriter() throws "IllegalStateException" in servlet runtime
Dear members,
IHAC who claims that OC4J jsp runtimes throws "IllegalStateException" when executing a scriptlet that is like:
PrintWriter writer = response.getWriter();
writer.println("Hello, World");
inside a jsp file.
The exception says that the writer is already being used and cannot be accessed twice.
However, the customer claims that the same code works in Tomcat without any problem.
Is this behavior expected? Is this in accordance with the servlet standard?
I know that the problem can be addressed with a workaround of retrieving the
outputstream instead of a writer, but I would like to know whether this issue
is currently to be resolved.
Thank YouHello Flavio,
Instead of passing the Output Stream in the first place and passing it to the Java class, you might want to change the approach as:
Java Servlet CALLS> Java program ---- QUERY ---> Database
Java Program is not decoupled with Web Container specific APIs like OutputStream. Java Program only returns byte [] of the image from the Database.
In the Servlet you can have a Try catch around the Java Program call and in case error happens, open the servletoutputstream and send error message. if everything is successfull, send the byte [] content with appropriate mime type out.
Thanks,
Paz -
Hello ,
My name is Avi. I want to create a folder on desktop for mac as well for windows. I want to create this folder using javascript. I am using cs3.
When anybody try to run this script on any operating system the folder will be create on desktop or any where as per users requirement.
Is there any logic between paths of mac osx and windows directory. Using that i can create a folder on any operating system.
I want to create a single script which can use for both operating system.
I knew how to create a folder using FILE SYSTEM ACCESS
create a folder object(folderobj)
To create a folder use folderobj.create().
Is this information sufficient to understand my problem or i need to explain it more.
Thank you for your co-operation.Thank you Kasyan.
I have one more question for you.
I created a edittext field using scriptUI and i want to get the data from that textfield.
I use variable editcontets to get the data but in this case it not working. I am posting my script. Please let me know if there is any thing wrong i am doing.
var g3 = myDlg.msgPnl1.add( "group" );
myDlg.msgPnl1.titleSt = g3.add('statictext', undefined, 'Name: ');
myDlg.msgPnl1.titleEt = g3.add('edittext', undefined,'Test');
var amit = myDlg.msgPnl1.titleEt.editContents;
alert(amit);
myDlg.msgPnl1.create = g3.add('button', undefined, 'Create');
myDlg.msgPnl1.titleSt = g3.add('statictext', undefined, ' ');
when you run the script whatevery data in that text field will come o the variable amit.
When i am trying to run this script i am getting alert as "undefined".
I do not why please help me in this matter as well.
Thank you, -
ParameterBindingException when pipelining an Outlook.Folder object to custom cmdlet
Hello all-
I've written a simple C# powershell cmdlet (Get-Store) that returns an Outlook Object Model Store object. Another cmdlet I've written reads the above Store object from the pipeline and creates an email folder (Get-Folder)
I get a ParameterBindingException when piping the returned store object from Get-Store to Get-Folder.
If I create the store object manually on the PS command line, via new-object, then pipe it to Get-Folder, it works.
It appears the errant store object is a __comObject type, while the store object that works is a Outlook.StoreClass type. Does anyone know how I can make this work?
Here's a transcript of the PS session:
PS c:\ps\mapi\bin\x64\Debug> import-module .\mapi.dll
PS C:\ps\mapi\bin\x64\Debug> $app = new-object -com Outlook.Application
PS C:\ps\mapi\bin\x64\Debug> $stores = $app.Session.stores
PS C:\ps\mapi\bin\x64\Debug> $storeOK = $stores[1]
PS C:\ps\mapi\bin\x64\Debug> $storeOK.GetType()
IsPublic IsSerial Name
BaseType
True False StoreClass
System.__ComObject
PS C:\ps\mapi\bin\x64\Debug> $storeOK | Get-Folder -path inbox\works -CreateIfNotExist
Application : Microsoft.Office.Interop.Outlook.ApplicationClass
Class : 2
Session : Microsoft.Office.Interop.Outlook.NameSpaceClass
Parent : System.__ComObject
DefaultItemType : 0
DefaultMessageClass : IPM.Note
Description :
EntryID : 0000000029542A42175B114D983D2C3446907A490100B870629719727B4BA82A6C06A31C2912004C5FB6DB8F0000
Folders : System.__ComObject
Items : System.__ComObject
Name : works
StoreID : 0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D44422E444C4C00000000000000001B55FA20AA6611
CD9BC800AA002FC45A0C00000048514D41494C5356523031002F6F3D4964656E746943727970742F6F753D45786368
616E67652041646D696E6973747261746976652047726F7570202846594449424F484632335350444C54292F636E3D
526563697069656E74732F636E3D6C657300
UnReadItemCount : 0
UserPermissions : System.__ComObject
WebViewOn : False
WebViewURL :
WebViewAllowNavigation : True
AddressBookName :
ShowAsOutlookAB : False
FolderPath :
\\[email protected]\Inbox\works
InAppFolderSyncObject : False
CurrentView : System.__ComObject
CustomViewsOnly : False
Views : System.__ComObject
MAPIOBJECT : System.__ComObject
FullFolderPath :
\\[email protected]\Inbox\works
IsSharePointFolder : False
ShowItemCount : 1
Store : System.__ComObject
PropertyAccessor : System.__ComObject
UserDefinedProperties : System.__ComObject
PS C:\ps\mapi\bin\x64\Debug> $storeNotOK = Get-Store -StoreName
[email protected]
PS C:\ps\mapi\bin\x64\Debug> $storeNotOK.GetType()
IsPublic IsSerial Name
BaseType
True False __ComObject
System.MarshalByRefObject
PS C:\ps\mapi\bin\x64\Debug> $storeNotOK | Get-Folder -path inbox\DoesntWork -CreateIfNotExist
Get-Folder : The input object cannot be bound to any parameters for the command either because the command does not
take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:15
+ $storeNotOK | Get-Folder -path inbox\DoesntWork -CreateIfNotExist
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (System.__ComObject:PSObject) [Get-Folder], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,mapi.Get_OutlookFolder
Here's the code:
namespace mapi
[Cmdlet(VerbsCommon.Get,
"Store")]
public class
Get_Store : PSCmdlet
protected override
void ProcessRecord()
base.ProcessRecord();
this.WriteObject(_getStore());
this.WriteDebug("Get-App::ProcessRecord");
public Application _getApplication()
Application app = new
Application();
return app;
[Parameter(Position = 0, ValueFromPipeline =
false)]
[ValidateNotNullOrEmpty]
public string StoreName
get { return _storeName; }
set { _storeName = value.ToLower(); }
string _storeName;
public Store _getStore()
Application app = null;
try
if (null == _storeName)
throw new
ArgumentException("Missing argument 'StoreName'");
app = _getApplication();
foreach (Store store
in app.Session.Stores)
if (store.DisplayName.ToLower() == _storeName)
return store;
if (null != store)
Marshal.ReleaseComObject(store);
return null;
finally
if (null != app)
Marshal.ReleaseComObject(app);
[Cmdlet(VerbsCommon.Get,
"Folder")]
public class
Get_OutlookFolder : PSCmdlet
[Parameter(Position = 0, ValueFromPipeline =
true, ValueFromPipelineByPropertyName =
false)]
[ValidateNotNullOrEmpty]
public Microsoft.Office.Interop.Outlook.Store Store
get
return _store;
set
_store =
value;
Store _store;
[Parameter(Position = 0,ValueFromPipeline =
false)]
public string Path
get { return _folderPath; }
set { _folderPath = value; }
string _folderPath;
[Parameter(Position = 1, ValueFromPipeline =
false)]
public SwitchParameter CreateIfNotExist
get { return _createIfNotExist; }
set { _createIfNotExist =
value; }
bool _createIfNotExist=false;
protected
override void ProcessRecord()
this.WriteDebug("Get-Folder::ProcessRecord");
this.WriteObject(_createFolder());
private void _createOrOpenFolder(string path,
MAPIFolder parent, ref
MAPIFolder ret)
if (null == path ||
"" == path)
ret = parent;
return;
string [] toks = path.Split('\\');
if (null == toks)
throw new
ArgumentException("folder path is invalid: " + _folderPath);
string folderName = toks[0];
MAPIFolder targetFolder = SearchChildFolders(parent, folderName);
if (null != targetFolder)
path = path.Remove(0, folderName.Length);
path = path.TrimStart('\\');
_createOrOpenFolder(path, targetFolder,
ref ret);
else
// start creating
if (_createIfNotExist)
foreach (string newFolderName
in toks)
//if (null != targetFolder)
// Marshal.ReleaseComObject(targetFolder);
targetFolder = parent.Folders.Add(newFolderName);
//Marshal.ReleaseComObject(parent);
parent = targetFolder;
// return the last one on the path
ret = targetFolder;
else
throw new
ItemNotFoundException("Folder '" + folderName +
"' not on the path '" + _folderPath +
"' and CreateIfNotExist argument not passed.");
MAPIFolder SearchChildFolders(MAPIFolder parent,
string name)
foreach (MAPIFolder f
in parent.Folders)
if (f.Name.ToLower() == name)
return f;
else
Marshal.ReleaseComObject(f);
return null;
// return the requested folder.
public MAPIFolder _createFolder()
if (null == _folderPath)
throw new
ArgumentNullException("_folderPath");
if (null == _store)
throw new
ArgumentNullException("_store");
MAPIFolder ret = null;
_createOrOpenFolder(_folderPath,
_store.GetRootFolder(),
ref
ret);
return ret;Hi Lesthaler,
For the error you got in powershell, please confirm the parameter in the cmdlet Get-Folder accepts what kind of pipeline input type, this error indicates a wrong pipeline type.
For more detailed information to troubleshoot this error, you can also check this article:
about_Pipelines
If you need suggestions of the C# script, please go to the C# forum for a more effective support:
Visual C#
I hope this helps. -
JUnit test fixture where constructor of base object throws exception
I'm trying to construct a test case which requires an object whose constructor currently throws and exception (it tries to make a connection which isn't currently available).
Now normally the trick would be to construct a test fixture class which extends the base class and returns the stuff I want. The trouble is I can't cope with an exception in in super constructor. Is there any way out of this, short of refactoring the offending base class?Just use the no-arg constructor of RootRenderingContext, and all should be defaulted appropriately.
-
Check read/write acces to a certain folder without throwing exceptions
Hello
Can somebody help me in finding a method for getting the read/write acces status to a certain location?
I need to have a function wich return me true when I have acces to read inside a folder for instance.
Thanks in advance, Ciprian LUPUIt appears as if you are somehow attempting to retrieve access control for a folder on a website (http://www.schaeffler.com/brasov/DATA/SP-ISB-F/F) using the below line. Is that correct?
I would recommend reading the
TOS of that site before proceeding any further.
schaeffler.com\brasov\DATA\SP-ISB-F\F
I'm not certain the code you are attempting to use could possibly do that. I tried accessing that link using http and ftp from a browser but nothing was found or returned.
It's more than likely you would have to use some sort of webrequest of ftp capability to attempt to get that information if that folder exists. And I would suppose an account would have to be logged onto or something in order to access that location as I
can not do it with a webbrowser nor am I asked to logon to access that location.
Are you certain that location exists on that website?
This is the error I received attempting to access that location with the code you used.
System.InvalidOperationException: Method failed with unexpected error code 3.
at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity..ctor(Boolean isContainer, ResourceType resourceType, String name, AccessControlSections includeSections, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections)
at System.IO.FileInfo.GetAccessControl()
at WindowsApplication1.Form1.CanReadFolder(String DirectoryName) in C:\Users\John\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb:line 20
Method failed with unexpected error code 3.
at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity..ctor(Boolean isContainer, ResourceType resourceType, String name, AccessControlSections includeSections, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext)
at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections)
at System.IO.FileInfo.GetAccessControl()
at WindowsApplication1.Form1.CanReadFolder(String DirectoryName) in C:\Users\John\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb:line 20
La vida loca -
"Manage Folders" or exporting folder objects slow in Discoverer Admin
Hi everyone,
I have an issue when we try to export folders from the EUL OR when we do Tools -> Manage Folders from within the Discoverer Administrator application. When I do the export by doing File -> Export, then "Selected objects in the End User Layer", and then select "Folders" in the objects drop down that appears in step two of the export wizard, it takes forever for the folders to come up and be ready for me to select the folders I want. It takes about 15 to 20 minutes. We have the same issue when we do Tools -> Manage Folders, it takes 15 to 20 minutes for the folders to load so we can assign any orphaned folders to business areas.
I put in an SR for this and Oracle is still working this issue. They gave me some registry settings to check and/or set to try to speed this up, but that does not work for me. They are also saying they have not heard of complaints like this in regards to their 11g version.
We are using both the Discoverer 10g (Administrator version 10.1.2.1) and are in the process of testing Discoverer 11g (Administrator version 11.1.1.3). It is doing this in both versions and the behavior is seen on multiple machines. We do not have any machine where the folders load quickly.
During the export wizard, if we select workbooks or item classes to export, it is pretty fast to bring up the list.
Oracle suggested I try doing an export from the command line and I have done that, but it takes about 15 minutes to create the EEX file this way.
I am wondering if anyone else has seen this type of performance issue and if so, was there a solution to improve it.
When we started testing 11g, I was hoping they would have implemented an easy solution to this, like you could right click on a folder in the Business Area and an "Export" option would present itself in the right-click menu, but that was wishful thinking.
Regards,
Jerry
Edited by: jlmorris on Jul 27, 2011 11:06 AMHi,
You say that it happen from several machines so I would go for the metadata structure in the database, maybe the performance issue starts there?
When is the last time the database schema of the discoverer was maintained ?
did you run statistics on it lately ? maybe there are tables or indexes that need to take care of ?
Those are the tables that holds the metadata for the folders.
I suggest you will rebuild the indexes on the following tables and see if it effect you:
eul_us.eul5_ba_obj_links
eul_us.eul5_objs
Anyway i would run statistics for the schema of the discoverer and rebuild the indexes to make sure that the problem doesn't start at the database level.
Tamir -
PofHelper.checkDate() throws IllegalStateException on high year values
I'm using Coherence 3.4.2, and this method throws an IllegalStateException if the year is an unusually high value (9999 for example).
Is there a good reason for this check to exist? If so, what's the best way for me to work around this issue? While we are updating our data to not use year 9999 anywhere, I'd rather update the code to allow these dates.
thanks, Aidan
Edited by: aidanol on Jan 20, 2010 11:13 AMHi Aidan,
I believe Coherence PofHelper year 'checks' are for a range of 1582-2199, which may just be a subset of Java's own Gregorian calendar implementation.
Date field ranges are typically based on an underlying Calendar rather than merely being a mere set of digits. (Just because the year is an int, doesnt mean we can automatically encode years up to 2^31-1). Basing on a calendar allows for standard date-related functions to work correctly (day-of-week, leapyear, etc). The Gregorian calendar is one commonly used - It has a complex set of rules which repeatedly cycle, however corrections are required every 100 or so years. For this reason, its simpler to rely on dates within a repeating cycle for accuracy (no correction logic necessary), so for example a date range of 1900-2199 is quite common. There are however 'perpetual' algorithms that can extrapolate further back or forward in time such as [1582-2400|http://utopia.knoware.nl/users/eprebel/Calendar/Perpetual/] (Gregorian was introduced in 1582 so thats typically the min year possible - to go further back you need to switch to a Julian calendar).
Due to the complexity of these calendar rules, one really needs to investigate the algorithm used to rely on the correctness of the calendar. (That conversely implies that if you dont care about such issues, you can simply use a Integer to represent the year with no date checks...) And yes - its more complicated than it needs to be.
PS. I do hope this isn't for a fix for the recent [ATM issues|http://bigpondnews.com/articles/Technology/2010/01/06/German_ATM_cards_hit_by_2010_bug_414437.html]. If your intention is for a date sentinel, think back to 1999, Y2K, etc... -
Forms9i -"ora_java.jobject" Instantiation of object throws err 201 message
Hi,
I am not able to instantiate a new object of class that i have created.
Below is the scenario.
Step1; Created a HelloWorld Class with 1 argument constructur
Another function getMessage which actually returns the message which was an argument.
Step2 : Compiled the Helloworld.. and is in c:\test folder
Step 3: I added this c:\test folder in Envinronment settings.
step 4: Opend forms 9i and imported the class HelloWorld.
Step 5: Opened up an pl/sql editor and started typing the below code
DECLARE
jo ora_java.jobject;
BEGIN
jo := HelloWorld.new('Test');
end;
If compiled it generates Error 201. HelloWorld.new('Test') must be declared.
What are the other settings i need to do for getting rid of this instantiation error.
Regards,
ashwath.Hi,
I am not able to instantiate a new object of class that i have created.
Below is the scenario.
Step1; Created a HelloWorld Class with 1 argument constructur
Another function getMessage which actually returns the message which was an argument.
Step2 : Compiled the Helloworld.. and is in c:\test folder
Step 3: I added this c:\test folder in Envinronment settings.
step 4: Opend forms 9i and imported the class HelloWorld.
Step 5: Opened up an pl/sql editor and started typing the below code
DECLARE
jo ora_java.jobject;
BEGIN
jo := HelloWorld.new('Test');
end;
If compiled it generates Error 201. HelloWorld.new('Test') must be declared.
What are the other settings i need to do for getting rid of this instantiation error.
Regards,
ashwath. -
Design Question - ignore or throw IllegalStateException?
Howdy all!
I have an interface that defines a number get and set methods. I have a particular implementation for which the set methods should not be called: unfortunately these set methods return int - which is allowed to be any int value.
Is it better that I ignore the call by returning -1 (even though this could be a legal value) or should I throw an exception such as IllegalStateException?
Thanks for any advice!
Rob
:)Is it better that I ignore the call by returning -1 (even though this could be a legal value) or should I >throw an exception such as IllegalStateException?If those methods should not be called, how do you pretend them to return a value if they are called?. This would be really confusing for someone using your code.
Throw the exception, or, better, change your desing and make that this particualr implementation dosen�t implement this interface (After all, why if this methods should never be called?).
Abraham. -
Having trouble with the File and Folder Objects (PSCS3 javascript on Win)
I'm having trouble successfully creating a new folder on my windows platform, using javascripts in photoshop. In ExtendScript Toolkit 2, set to Adobe Photoshop CS3, I've tried:
var myFolder = new Folder("/c/Documents and Settings/vcastelo/My Documents");
myFolder.create();
and
var myFolder = new Folder("/c/Documents and Settings/vcastelo/My Documents");
is this right? what am I doing wrong? It's pretty basic stuff, I know but I can't figure is out... any help would be greatly appreciated.[email protected] wrote:
> oh I see, I just figured it out... the drive designation isn't case sensitive... but i didn't add the name of new folder to the destination path.
Yep.
>
> var myFolder = new Folder("c:/Documents and Settings/vcastelo/My Documents/data");
> myFolder.create();
The "/c/Documents and Settings/vcastelo/My Documents/data" form works, too, and
should be preferred.
Here's an extreme example as to why this is a good idea:
I work in an XP/cygwin environment, so I added links to all of my drives in my
root cygwin folder. As a result, the path /p/Pictures/2008-05-05 is the same on
the bash command line (and other tools) as it is in PSJS. I carried this over to
my Mac, as well. I mount P: drive in OSX then setup links so that
/p/Pictures/2008-05-05 is also the same on the Mac. This has vastly simplified
my work. The only time I use system-specific pathnames is in a script's UI.
-X
for photoshop scripting solutions of all sorts
contact: [email protected] -
Remote connection to folder applescript throwing error after 10.6.7 update
I have the following applescript steps that have worked perfectly until we updated the two server machines it runs between (one is a file server, the other is a client machine running filemaker server):
--set initial values to the filesystem variables
set lstServer to "FileServer.local"
set lstFolder to "Files/Automated"
set lstSubfolder to "EventsReporter"
set lstAccountName to "*****"
set lstAccountPassword to "*****"
--this builds the connection string
set lstAFP to "afp://" & lstAccountName & ":" & lstAccountPassword & "@" & lstServer & "/" & lstFolder & "/" & lstSubfolder & "/"
--this is what the local computer will recognize as the mounted folder
set mountedFolder to lstSubfolder & ":"
--this behaves as both prefix filter and as the name of the subdirectory under the local Documents folder
set lstPrefix to "DVER"
repeat with idx from 1 to 3
set ping_result to (do shell script "ping -c 1 " & lstServer)
if ping_result contains "100% packet loss" then
delay 3
else
exit repeat
end if
end repeat
if idx ≥ 3 then return -1
--call the Finder application
--try
tell application "Finder"
activate
--check to see if the volume/folder is already mounted & if not then mount it
if not (exists mountedFolder) then
try
mount volume lstAFP
on error
return -1
end try
end if
--get a list of files in the remote folder & get a count of them
set mountedFolderRef to folder mountedFolder
The script now fails on the last step whereas it never did before:
set mountedFolderRef to folder mountedFolder
with the error:
error "Finder got an error: Can’t get folder \"EventsReporter:\"." number -1728 from folder "EventsReporter:"
This script must run without user intervention. What changed and where is it documented?? This has to be fixed, I cannot spare the time to continue to periodically move these files manually. This runs in two separate scripts with the only difference being the subfolder name and both have failed simultaneously. I am not very good with applescript and I do not know how to fix this newest issue.
Someone please help!Thank you for your reply
Actually, the situation has resolved itself. What we believe to be the case after having watched this error unfold itself, is that with file and/or filesystem level changes that may have been instituted for certain corrections to how it handles SMB, we feel that there may have been a background process crawling through the filesystem slowly making those changes file-by-file or sector-by-sector.
I would watch one portion of the remote access script work, then not work, then another quit working. Then after several hours they each can back online without error, one by one.
(* beginning of rant ...
It would have been nice to have a little notice about whatever was causing this issue so I didn't have to waste most of a day crawling the web for answers and tweaking various portions of a test script to see what now did work and what did not.
Ah, well. I suppose I should be used to such by now with apple :/
Am I being a dinosaur or can anyone else remember a day when complete documentation for a product was available with the product or by purchasing a relatively inexpensive reference book? These days it seems as though, where useful information is even available, it is only after many months after a product has come out and then it is at a premium. Even then most of it is only a surface description.
... end of rant *)
Maybe you are looking for
-
How to get notes from icloud to new iphone.
All my old iphone 4S 'notes' are stored in icloud. When I synced up my new iphone 5 it did not transfer the last ten months of notes onto the phone, just everything prior to that. So I'm nervous if I back up the notes I've made since, it may overwrit
-
How can I reset the xy zero point to a different spot in my PDF? Possibly via a plug-in?
I would like to reset my zero point to aid in measuring and aligning elements in PDFs. Indesign, Illustrator and Photoshop will let you do this but not Acrobat Pro. Any ideas? I also use Pitstop Pro but can't seem to find anything in there that can h
-
How Do I Print my reports Horizontally using Coldfusion Report Builder
Hi- I want to print my reports Horizontally rather vertically using Coldfusion Report Builder. I am using a very simple query SELECT Zones.Zone_id, Zones.Zone_name, Count(employees.cnic) as Employees FROM Zones, Employees WHERE Zones
-
How to handle multiple sessions in Script recorder
Hi, I have a requirement to update certain records from a program. For that I have to put a breakpoint the program (which I did manually). Now when I use the scripting tool to record the events, only events related to the original session gets record
-
Can't sync song that I imported. It's in the library but it's not syncing.
I have a Meditation CD that I purchased years ago in a small shop in Park City. The music is in my iTunes library, but I can never find the artwork, because the CD is a rare find. My issue is that everytime I get a new iPhone, most of the music dow