abuot VirtualFile.getWriter();
the Code:
VirtualFile virtualFile;
..
Write writer = virtualFile.getWriter(null);
but, I got a exception, is:
plication.impl.ApplicationImpl - IntelliJ IDEA (Aurora) Build #977
plication.impl.ApplicationImpl - JDK: 1.4.2_02
plication.impl.ApplicationImpl - VM: Java HotSpot(TM) Client VM
plication.impl.ApplicationImpl - Vendor: Sun Microsystems Inc.
plication.impl.ApplicationImpl - OS: Windows XP
plication.impl.ApplicationImpl - Last Action:
plication.impl.ApplicationImpl - Assertion failed: Write access is allowed
inside write-action only (see
com.intellij.openapi.application.Application.runWriteAction())
that's mean getWrite() or getOutputSteam() methods is by intellij inside
call only,
I want to write a file, how to write? Don't tell me use java.io.FileWrite or
java.io.FileOutputStream
thank's!
jdk:1.4.2
intellij is build #977
Please sign in to leave a comment.
Yang,
According to information I've gotten from IntelliJ folks and by experimentation:
(1) only the Swing dispatch thread can update (write to) documents -- this may not be a problem for you; but check
to be sure.
(2) The thread must obtain the application write-action lock using the following call:
At least, it has worked for me.
-Dave
Thank u very much, It's all right~
"Dave Kriewall" <no_mail@jetbrains.com> дÈëÓʼþ
news:8265540.1070869508571.JavaMail.javamailuser@localhost...