File Based Multithreaded Web Server Question

Hi friends,
I have the code of a simple File Based Multithreaded Web Server. I have been asked to add proper http/1.1 Keep-Alive behavior to it. As far as I understand it means to use the same socket for the request coming from the same client without opening a new socket for every request by it. I am unable to implement it. Any help would be greatly appreciated. The entire code is as below:
package multithreadedwebserver.com;
import java.io.*;
import java.net.*;
import java.util.*;
/** This Class declares the general and HTTP constants
* and defines general static methods:
class Constants {
/** 2XX: generally "OK" */
public static final int HTTP_OK = 200;
public static final int HTTP_CREATED = 201;
public static final int HTTP_ACCEPTED = 202;
public static final int HTTP_NOT_AUTHORITATIVE = 203;
public static final int HTTP_NO_CONTENT = 204;
public static final int HTTP_RESET = 205;
public static final int HTTP_PARTIAL = 206;
/** 3XX: relocation/redirect */
public static final int HTTP_MULT_CHOICE = 300;
public static final int HTTP_MOVED_PERM = 301;
public static final int HTTP_MOVED_TEMP = 302;
public static final int HTTP_SEE_OTHER = 303;
public static final int HTTP_NOT_MODIFIED = 304;
public static final int HTTP_USE_PROXY = 305;
/** 4XX: client error */
public static final int HTTP_BAD_REQUEST = 400;
public static final int HTTP_UNAUTHORIZED = 401;
public static final int HTTP_PAYMENT_REQUIRED = 402;
public static final int HTTP_FORBIDDEN = 403;
public static final int HTTP_NOT_FOUND = 404;
public static final int HTTP_BAD_METHOD = 405;
public static final int HTTP_NOT_ACCEPTABLE = 406;
public static final int HTTP_PROXY_AUTH = 407;
public static final int HTTP_CLIENT_TIMEOUT = 408;
public static final int HTTP_CONFLICT = 409;
public static final int HTTP_GONE = 410;
public static final int HTTP_LENGTH_REQUIRED = 411;
public static final int HTTP_PRECON_FAILED = 412;
public static final int HTTP_ENTITY_TOO_LARGE = 413;
public static final int HTTP_REQ_TOO_LONG = 414;
public static final int HTTP_UNSUPPORTED_TYPE = 415;
/** 5XX: server error */
public static final int HTTP_SERVER_ERROR = 500;
public static final int HTTP_INTERNAL_ERROR = 501;
public static final int HTTP_BAD_GATEWAY = 502;
public static final int HTTP_UNAVAILABLE = 503;
public static final int HTTP_GATEWAY_TIMEOUT = 504;
public static final int HTTP_VERSION = 505;
/* the Web server's virtual root directory */
public static File root;
static PrintStream log = null;
/* Configuration information of the Web server is present
* in this props object
protected static Properties props = new Properties();
/* timeout on client connections */
static int timeout = 0;
/* maximum number of worker threads */
static int workerThreads = 5;
/* General method for printing strings */
static void printString(String s) {
System.out.println(s);
/* print logs to the log file */
static void log(String s) {
synchronized (log) {
log.println(s);
log.flush();
/* print to the log file */
static void printProperties() { 
printString("\n");
printString("#####################################################################");
printString("\n");
printString("Web server's virtual root directory= "+root);
printString("Timeout on client connections in milliseconds= "+timeout);
printString("Number of Worker Threads= "+workerThreads);
printString("\n");
printString("#####################################################################");
printString("\n\n");
printString("********************WEBSERVER STARTED SUCCESSFULLY********************\n");
/* load server.properties from java.home */
static void loadServerConfigurationProperties() throws IOException {
File f = new File(System.getProperty("java.home")+"\\lib\\"+"server.properties");
if (f.exists()) {
InputStream is =new BufferedInputStream(new FileInputStream(f));
props.load(is);
is.close();
String r = props.getProperty("root");
if (r != null) {
root = new File(r);
if (!root.exists()) {
throw new Error(root + " Server Root Directory does not exist");
r = props.getProperty("timeout");
if (r != null) {
timeout = Integer.parseInt(r);
r = props.getProperty("workerThreads");
if (r != null) {
workerThreads = Integer.parseInt(r);
r = props.getProperty("log");
if (r != null) {
log = new PrintStream(new BufferedOutputStream(
new FileOutputStream(r)));
/* Assign default values to root, timeout,
* workerThreads and log if the same have
* not been specified in the server.propwerties file
if (root == null) {   
root = new File(System.getProperty("user.dir"));
if (timeout <= 1000) {
timeout = 5000;
if (workerThreads > 25) {
printString("\n");
printString("#####################################################################");
printString("\n");
printString("Too many Threads!!!Maximum number of Worker Threads can be 15 only");
printString("\n");
printString("#####################################################################");
workerThreads = 15;
if (log == null) {
log = System.out;
public class WebServer extends Constants {
/* Specifying Default port for listening the requests */
static int port = 8080;
/* The Vector class implements a growable array of objects.
* Like an array, it contains components that can be accessed using an integer index.
* The size of a Vector can grow or shrink as needed to accommodate adding and
* removing items after the Vector has been created.
* The workerThreads are added to the Vector object threads where the worker threads stand idle
* Vector is used since it is synchronized
static Vector threads = new Vector();
public static void main(String[] userSpecifiedPort) throws Exception {
if (userSpecifiedPort.length > 0) {
port = Integer.parseInt(userSpecifiedPort[0]);
loadServerConfigurationProperties();
printProperties();
/* Instantiate ThreadPoool class and call
* the createThreadPool() method on threadPool object
ThreadPool threadPool= new ThreadPool();
threadPool.createThreadPool();
/* This class implements java.lang.Runnable.
* It runs in a worker thread to process the request and serve files to the clients.
class Worker extends WebServer implements Runnable {
static final byte[] EOL = {(byte)'\r', (byte)'\n' };
final static int BUFFER_SIZE = 2048;
/* A byte array buffer to read and write files.
* Memory is allocated to it once in the construtor of the class Worker
* and reused thereafter
byte[] buffer;
/* Socket for the client being handled */
private Socket socket;
Worker() {
buffer = new byte[BUFFER_SIZE];
socket = null;
synchronized void setSocket(Socket socket) {
this.socket = socket;
notify();
public synchronized void run() {
do {
if (socket == null) {
/* Wait */
try {
wait();
} catch (InterruptedException e) {
continue;
try {
handleClientRequest();
} catch (Exception e) {
e.printStackTrace();
socket = null;
Vector pool = WebServer.threads;
synchronized (pool) {
/* When the request is complete add the worker thread back
* into the pool
pool.addElement(this);
}while(true);
void handleClientRequest() throws IOException {
InputStream is = new BufferedInputStream(socket.getInputStream());
PrintStream ps = new PrintStream(socket.getOutputStream());
/* we will only block in read for this many milliseconds
* before we fail with java.io.InterruptedIOException,
* at which point we will abandon the connection.
socket.setSoTimeout(WebServer.timeout);
socket.setTcpNoDelay(true);
/* Refresh the buffer from last time */
for (int i = 0; i < BUFFER_SIZE; i++) {
buffer[i] = 0;
try {
/* We will only support HTTP GET/HEAD */
int readBuffer = 0, r = 0;
boolean endOfLine=false;
while (readBuffer < BUFFER_SIZE) {
r = is.read(buffer, readBuffer, BUFFER_SIZE - readBuffer);
if (r == -1) {
/* EOF */
return;
int i = readBuffer;
readBuffer += r;
for (; i < readBuffer; i++) {
if (buffer[i] == (byte)'\n' || buffer[i] == (byte)'\r') {
/* read one line */
endOfLine=true;
break;
if (endOfLine)
break;
/*Checking for a GET or a HEAD */
boolean doingGet;
/* beginning of file name */
int index;
if (buffer[0] == (byte)'G' &&
buffer[1] == (byte)'E' &&
buffer[2] == (byte)'T' &&
buffer[3] == (byte)' ') {
doingGet = true;
index = 4;
} else if (buffer[0] == (byte)'H' &&
buffer[1] == (byte)'E' &&
buffer[2] == (byte)'A' &&
buffer[3] == (byte)'D' &&
buffer[4] == (byte)' ') {
doingGet = false;
index = 5;
} else {
/* This method is not supported */
ps.print("HTTP/1.0 " + HTTP_BAD_METHOD +
" unsupported method type: ");
ps.write(buffer, 0, 5);
ps.write(EOL);
ps.flush();
socket.close();
return;
int i = 0;
/* find the file name, from:
* GET /ATG/DAS6.3.0/J2EE-AppClients/index.html HTTP/1.0
* extract "/ATG/DAS6.3.0/J2EE-AppClients/index.html "
for (i = index; i < readBuffer; i++) {
if (buffer[i] == (byte)' ') {
break;
String filename = (new String(buffer, 0, index,
i-index)).replace('/', File.separatorChar);
if (filename.startsWith(File.separator)) {
filename = filename.substring(1);
File targ = new File(WebServer.root, filename);
if (targ.isDirectory()) {
File ind = new File(targ, "index.html");
if (ind.exists()) {
targ = ind;
boolean fileFound = printHeaders(targ, ps);
if (doingGet) {
if (fileFound) {
sendResponseFile(targ, ps);
} else {
fileNotFound(targ, ps);
} finally {  
// socket.close();
System.out.println("Connection Close nahi kiya");
boolean printHeaders(File targ, PrintStream ps) throws IOException {
boolean ret = false;
int responseStatusCode = 0;
if (!targ.exists()) {
responseStatusCode = HTTP_NOT_FOUND;
ps.print("HTTP/1.0 " + HTTP_NOT_FOUND + " not found");
ps.write(EOL);
ret = false;
} else {
responseStatusCode = HTTP_OK;
ps.print("HTTP/1.0 " + HTTP_OK+" OK");
ps.write(EOL);
ret = true;
log("From " socket.getInetAddress().getHostAddress()": GET " +
targ.getAbsolutePath()+"-->"+responseStatusCode);
ps.print("Server: Simple java");
ps.write(EOL);
ps.print("Date: " + (new Date()));
ps.write(EOL);
if (ret) {
if (!targ.isDirectory()) {
ps.print("Content-length: "+targ.length());
ps.write(EOL);
ps.print("Last Modified: " + (new
Date(targ.lastModified())));
ps.write(EOL);
String name = targ.getName();
int ind = name.lastIndexOf('.');
String ct = null;
if (ind > 0) {
ct = (String) map.get(name.substring(ind));
if (ct == null) {
ct = "unknown/unknown";
ps.print("Content-type: " + ct);
ps.write(EOL);
} else {
ps.print("Content-type: text/html");
ps.write(EOL);
return ret;
void fileNotFound(File targ, PrintStream ps) throws IOException {
ps.write(EOL);
ps.write(EOL);
ps.println("The requested file could not be found.\n");
void sendResponseFile(File targ, PrintStream ps) throws IOException {
InputStream is = null;
ps.write(EOL);
if (targ.isDirectory()) { ;
listDirectory(targ, ps);
return;
} else {
is = new FileInputStream(targ.getAbsolutePath());
try {
int n;
while ((n = is.read(buffer)) > 0) {
ps.write(buffer, 0, n);
} finally {
is.close();
/* mapping file extensions to content-types */
static java.util.Hashtable map = new java.util.Hashtable();
void listDirectory(File dir, PrintStream ps) throws IOException {
ps.println("<TITLE>Multithreaded Webserver</TITLE><P>");
ps.println("<html><body align=center>");
ps.println("<center><h3><font color=#9999CC>Simple File Based MultiThreaded WebServer</font></h3></center>");
ps.println("<table border=1 align=center>");
ps.println("<tr bgcolor=#9999CC><td width=100% height=100% align=center><h3>Directory Listing</h3></td>");
ps.println("<td width=40% height=40% align=center><h3>Type</h3></td>");
String[] list = dir.list();
for (int i = 0; list != null && i < list.length; i++) {
File f = new File(dir, list);
if (f.isDirectory()) {
ps.println("<tr><td>");
ps.println("<font size=\""+"2"+"\"face=\""+"Verdana"+"\"> <A HREF=\""+list[i]+"/\">"+list[i]+"</A></font><a href=\""+list[i]+"/\"></a>\n<BR></td>");
ps.println("<td align=center><a href=\""+list[i]+"/\"><img src=\""+"/images/folder.jpg"+"\"></img></a>");
ps.println("</td");
ps.println("</tr>");
} else {
ps.println("<tr><td>");
ps.println("<font size=\""+"2"+"\" face=\""+"Verdana"+"\"></A> <A HREF=\""+list[i]+"\">"+list[i]+"</A></font><A HREF=\""+list[i]+"\"></A>\n<BR></td>");
ps.println("<td align=center><a href=\""+list[i]+"/\"><img src=\""+"/images/file.gif"+"\"></img></a>");
ps.println("</tr>");
ps.println("</table>");
ps.println("<P><HR><I><font color=blue>"+(new Date())+"</font></I>");
ps.println("<I><font color=blue>Copyright to HCL Technology Ltd</font></I>");
ps.println("<I><font color=blue>Author Vivek Kumar Sinha</font></I>");
ps.println("</body></html>");
The ThreadPool class contains a Vector of WorkerThread objects.
These objects are the individual threads that make up the pool.
The WorkerThread objects will start at the time of their construction.
If there are more HTTP requests than there are WorkerThreads,
the extra requests will backlog until WorkerThreads free up.
class ThreadPool extends WebServer{
void createThreadPool(){
for (int i = 1; i <= workerThreads; ++i) {
Worker w = new Worker();
Thread t=new Thread(w, "Worker Thread No."+i);
t.start();
/* Uncomment to check the number of worker threads running */
// printString("Worker Thread No."+i+" Started");
threads.addElement(w);
try{
ServerSocket serversocket = new ServerSocket(port);
do {
Socket socket = serversocket.accept();
Worker w = null;
synchronized (threads) {
if (threads.isEmpty()) {
/* Do nothing */
} else {
w = (Worker) threads.elementAt(0);
threads.removeElementAt(0);
w.setSocket(socket);
} while (true);
} catch (IOException e) {
e.printStackTrace();

Thank you for Welcoming me!!! I am very new to this forum so din't have this idea.
I am unable to add the keep alive behavior . I don't have problem with any part of the code. The problem is i don't know how to make that enhancement in the existing code.
Regards

Similar Messages

  • Transmitting and Receiving an audio file in a web server

    Hello all,
    How do I transmit an audio file from a Web Server as requested by a web based thin client (jsp)?
    Rgds,
    Seetesh

    If I were to use the programs : Transmitter and Receiver
    Transmitter
    http://java.sun.com/products/java-media/jmf/2.1.1/solutions/RTPTransmit.html
    Receiver
    http://java.sun.com/products/java-media/jmf/2.1.1/solutions/AVReceive.html
    Can the same be writen as either a Servlet or JSP so that the same can be executed on a Web Server?
    Any workaround on the code to make it run.
    Rgds,
    Seetesh

  • Deploying war files on iplanet web server 6.0

    Hello All,
    I tried to deploy an war file on iplanet web server 6.0 using both command line wdeploy and iplanet webserver browser based admin tool. Both the times it did say successfully deployed. I checked the WEB-INF files and it does contain all class files..But the problem is when I try to post a form to one of the class files the error log says as if it cannot find the class file.(I tried the sample app HelloWorld supplied by vendor)
    =========
    05/Mar/2002:13:19:14] config (13777): for host xx.xx.xx.xx trying to POST /samples/helloworld/GreeterServlet, handle-processed reports: The request method is not applicable to this requested resource.
    =================
    any help in this regards is appreciated
    Thanks
    sudhir

    Hello,
    I got few steps to deploy the WAR file, if you followed the same steps and got the error then ignore this else try with this steps.
    a) Set your environment variable IWS_SERVER_HOME to your server_root directory.
    b) Add the server_root/bin/https/httpsadmin/bin directory to your classpath.
    c) Configure your virtual server for web applications.
    From the Server Manager page, select the VirtualServerClass tab, select a Class, and click the Manage button.
    Select a Virtual Server and go to the Java Web Apps Settings page for that virtual server. Make sure that the virtual server has Web Apps State turned On, and web-apps.xml is the name of Web Apps File.
    To extract the sample WAR file HelloWorld.war in server_root/plugins/servlets/examples/web-apps/HelloWorld, use the wdeploy command as follows:
    wdeploy deploy -u /hello -i server.iplanet.com -v testvs -d
    /iws60/https-server.mydomain.com/testvs/web-apps/hello
    /iws60/plugins/servlets/examples/web-apps/HelloWorld/HelloWorld.war
    The syntax for the command is as follows:
    wdeploy deploy -u uri_path -i instance -v vs_id [-d directory] war_file
    uri_path Specify the URI prefix (a path to access the web application from the browser).
    instance Specify the server instance name. (Note: Do not include "https" in the front.)
    vs_id Specify the Virtual Server name as it appears on the Manage Virtual Servers page.
    directory Specify a directory to extract WAR files. If this directory doesn't exist already, it will be created for you now.
    war_file Specify the name of the WAR file.
    If the WAR file is extracted successfully, the message "web application deploy successful" appears at the command line.
    For verification, go to the /iws60/https-server.iplanet.com/testvs/web-apps/hello directory. It should have the following contents:
    colors
    index.jsp
    META-INF
    WEB-INF/
    web.xml
    /classes/
    HelloWorldServlet.class
    HelloWorldServlet.java
    SnoopServlet.class
    SnoopServlet.java
    In the server_instance/config directory, the web-apps.xml file should have the following entry:
    <vs>
    <web-app uri="/hello"
    dir="/iws60/https-server.iplanet.com/testvs/web-apps/hello"/>
    </vs>
    Restart the server instance from the command line or go to the admin GUI and apply configuration changes to the server instance.
    Now when you access the webserver instance in your browser, the Error log of that server instance will record successful initialization of the web application environment(web-apps.xml) for the virtual server(vs name). You can access the web application from a browser as follows:
    http://server.Mydomain.com:80/hello/index.jsp
    or:
    http://server.Mydomain.com/hello/
    The syntax is as follows:
    http://vs_urlhost[:vs_port]/uri_path/[index_page]
    Thanks
    Selva

  • I want to cache all files in my web server for JRE auto installation

    Hi,
    I have written an application for my customer. When they access my web server, they will auto-install jre 6.12 and then load my application using jnlp. All that is done, but i want to improve in the following ways:
    1. I want to have more quiet installation of java. It should only show progress bar or just run in background. In the jre installation file (cab file), there is a file jinstall-6u12.inf, the last line is "run=%EXTRACT_DIR%\jinstall.exe /installurl=http://localhost/1.6.0_12-b04.xml /installmethod=plugin". What should I add to this line to make the installation more quiet?
    2. When my client install jre, i want them to fetch all necessary files from my web server, so when java web site is down, i can still provide files they need to install java. I am aiming jre 6.12 only.
    Thank you in advance.
    William

    Open Macintosh HD > Applications > Utilitiies > AirPort Utility
    Click on the Time Capsule icon
    In AirPort Utility 6.x.....click Edit to the right of the Time Capsule
    In AirPort Utility 5.x.....click Manual Setup
    Click the Disks icon/tab at the top of the next window
    Click Erase
    The "Quick Erase" option will only take a few minutes, but it is not a secure Erase.
    The "Zero Out" option will replace everything on the disk with zeros, and will likely take 4-6 hours for the process to complete, depending on the size of the drive.
    The erase procedure will only affect the disk. It will not affect any of the network settings, passwords, etc that you have stored on the Time Capsule.

  • Running a batch file on  a web server

    hi,
    i am facing a problem regarding running a batch file(with a java command in that file) on a web server.
    i am having a batch file which is running a chatapplication (this file is having a single line -- "java ChatServer 8080")
    i want to execute this command ( file ) on my web server
    can u help me plz ( i think u can)
    thanx 4 reading my problem...
    -ashish

    thanx 4 replying
    but as i am a developer and i am developing the aplication for a client, so should i speak to the client for this or can i do this without interrupting them?
    -ashish

  • Uploading a file to the web server

    How can i upload a file to the web server using JSP.

    hello sir,
    Could U even tell me performance which one is better.
    U have mentioned that Multipartrequest is Complex for Beginers,
    but as far as performance is concerned which is better.
    If Taglib is used is it error Free , as I do not know much abt taglib.
    have just read a little abt it , have never created my own Custome Tag.
    Could U just Guide me which is the best site where I could get know a little abt Taglib.An easy tutorial where I could read and start working on My application.
    I have been given a Deadline. So Please help me man.
    If U have the source Code for Uploading of a File Please Cut Paste it.
    I have to finish the project on time .
    Please
    With Regards
    Eklavya

  • Deploying an ear file in Sun Web Server

    I have an ear file that we use to deploy to weblogic. Is it possible to deploy an ear file to Sun WEb Server 6.0? Instead of deploying the war files one-by-one?
    If yes, what are the steps?
    Thanks.
    Beth

    No, Sun ONE Web Server does not support ear files; ear files are typically the domain of J2EE application servers.

  • Captivate Files Loaded on Web Server

    I have loaded a captivate file (along with all its dependent files) onto a web server in order to link it to our Plateau LMS.  I had no problem with the link, but a narration that is supposed to start later in the file begins when the main Captivate page is opened.  I am not the creator of the Captivate file and have never worked with the program.  Is there something that needs to be done to the file to keep it from doing this?

    Are you using Aggregator? Or is is a very long project? I've noticed Aggregator projects often want to jump into the audio while the presentation is still loading. The easiest fix for that is via Edit --> Preferences. Select Start and End in the Project group, uncheck Auto Play, and, as a touch of class, add a graphic to be displayed until the user presses the play button (which will be in the middle of the presentation when it loads).

  • Browse Files on a Web Server

    Hello,
    How could I start writing an applet for viewing files on my web server? I looked around the forum and on the net but couldn't find anything very helpful. Any resources or links are also much welcome.
    Thanks,
    LD

    Thanks for your reply Andy,
    All I want to do now is have something user friendly so that they could browse a tree folder and download some files on my web server. I don't really know if I should stick with Java or opt out and go try using JavaScript or other scripts - what's your view on this?
    I wrote some code in Java that creates a folder tree, starting from the folder where the applet is placed. Then I would have a table showing all the files etc...In my IDE it works fine but on the server it either doesn't show anything or complains about security issues (I tried different methods).
    (My web server is just a common commercial web server. When there's no index.html on a particular folder on the server and I locate it in my web browser, it does show a listing of all that is in there.)
    Here's my code:
    Thanks for your help,
    LD
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.io.File;
    import java.io.FileFilter;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.UIManager;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class WebServerFileBrowser extends Applet
        private JTree dirTree;
        private JScrollPane treeSPane;
        String root;
        /** Initializes the applet WebServerFileBrowser */
        public void init()
            try {
                java.awt.EventQueue.invokeAndWait(new Runnable()
                    public void run()
                        // Set applet's look and feel as the system's
                        try {
                            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                        } catch (Exception ex) {
                            ex.printStackTrace();
                        //End of settings    
                        initComponents();
            } catch (Exception ex) {
                ex.printStackTrace();
        private void populateDirTree()
    //        System.out.println(getCodeBase());
    //        root = "D:\\TestDir";       
            try {
                // Getting the root directory which is the directory where the applet is located
                File rootDir = new File (".");
                root = rootDir.getCanonicalPath();
                File topDir = new File(root); // The top/root directory
                DefaultMutableTreeNode treeTop = new DefaultMutableTreeNode(new Folder(topDir)); // The top node of the directory tree
                growDirTreeNodes(treeTop, topDir);
                dirTree = new JTree(treeTop); // After the directory tree nodes are fully grown, add them into the directory tree
            } catch (Exception ex) {
                ex.printStackTrace();
            JOptionPane.showMessageDialog(this, root);
        // Implementing the concept of recurrence, the directory tree is grown top down
        private void growDirTreeNodes(DefaultMutableTreeNode node, File dir)
            File[] dirs = getDirList(dir);
            for (int i = 0; i < dirs.length; i++) {
                node.add(new DefaultMutableTreeNode(new Folder(dirs)));
    growDirTreeNodes(((DefaultMutableTreeNode) node.getChildAt(i)), dirs[i]);
    // This method is used to return an array of child directories that are in a parent directory
    private File[] getDirList(File dir)
    File[] dirs = dir.listFiles(new FileFilter()
    public boolean accept(File file)
    return file.isDirectory();
    return dirs;
    private void initComponents()
    setLayout(new BorderLayout());
    populateDirTree();
    treeSPane = new JScrollPane(dirTree);
    add(treeSPane);
    * This sub class represents a folder which is equivalent to a directory
    * Main reason for this class' existence is to override the toString() method
    * so that when added into the dirTree, the nodes show the name of the folder
    * and not the full path of that directory
    class Folder
    private String name;
    private File dir;
    public Folder(File dir)
    this.dir = dir;
    name = dir.getName();
    public String getName()
    return name;
    public File getDir()
    return dir;
    public String toString()
    return name;

  • Problem uploading Muse-exported files on my Web server

    I'm using the FTP client Transmit for years and I'm very pleased with it.
    I use also Muse from the first preview and I always use the "Export to HTML" feature, and place the files on my remotely-hosted Web servers (NetSol).
    When I upload all kind of files (HTML, CSS, .ZIP, videos,…), everything works fine.
    Since yesterday, when I upload files generated by Muse, Transmit stalls and is unable to save the file on the Web server. I receive all kind of transfer errors.
    Something must have happened recently.
    I use the latest Muse CC2014 version and the latest Transmit version.
    I called NetSol support and they said they change nothing on their Web servers recently. They point out that all my non-Muse files upload correctly.
    The big problem is that I can't update my websites anymore.
    How to share here the exported Muse folder?
    Thank you.

    Switched to FileZilla
    Here's the current log and it is failing all the time.
    NetSol told me they have restarted the server and checked for authorisations, and they say it should work as it works for other files.
    Status:      Connection established, waiting for welcome message...
    Response: 230 Login successful.
    Command: SYST
    Response: 215 UNIX Type: L8
    Command: FEAT
    Response: 211-Features:
    Response:  EPRT
    Response:  EPSV
    Response:  MDTM
    Response:  PASV
    Response:  REST STREAM
    Response:  SIZE
    Response:  TVFS
    Response:  UTF8
    Response: 211 End
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Retrieving directory listing...
    Command: PWD
    Response: 257 "/"
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,122,127)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CWD /htdocs
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs"
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,123,133)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CWD /htdocs/indesign
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign"
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,124,119)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CWD /htdocs/indesign/digitalpublishing
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign/digitalpublishing"
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,125,9)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CWD /htdocs/indesign/digitalpublishing/twixl
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign/digitalpublishing/twixl"
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,125,96)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign/digitalpublishing/twixl/twixlfacts"
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,125,186)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Status:      Calculating timezone offset of server...
    Command: MDTM sitemap.xml
    Response: 213 20140918164807
    Status:      Timezone offsets: Server: 0 seconds. Local: 7200 seconds. Difference: 7200 seconds.
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CDUP
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign/digitalpublishing/twixl"
    Status:      Directory listing successful
    Status:      Retrieving directory listing...
    Command: CWD twixlfacts
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign/digitalpublishing/twixl/twixlfacts"
    Status:      Directory listing successful
    Command: DELE sitemap.xml
    Response: 250 Delete operation successful.
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/site_global.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/index.css
    Response: 250 Directory successfully changed.
    Command: TYPE A
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 250 Directory successfully changed.
    Command: TYPE A
    Response: 227 Entering Passive Mode (206,188,192,135,130,87)
    Command: STOR site_global.css
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,130,92)
    Command: STOR index.css
    Response: 150 Ok to send data.
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connection established, waiting for welcome message...
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/site_global.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/index.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Response: 227 Entering Passive Mode (206,188,192,135,133,227)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,135,193)
    Command: STOR site_global.css
    Response: 227 Entering Passive Mode (206,188,192,135,135,195)
    Command: STOR index.css
    Response: 150 Ok to send data.
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/site_global.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,139,52)
    Command: LIST
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 150 Here comes the directory listing.
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 227 Entering Passive Mode (206,188,192,135,139,81)
    Command: STOR site_global.css
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/index.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,139,110)
    Command: STOR index.css
    Response: 150 Ok to send data.
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/index.html
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,143,173)
    Command: STOR index.html
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/muse_manifest.xml
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,143,241)
    Command: STOR muse_manifest.xml
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/index.html
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,146,182)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,146,224)
    Command: STOR index.html
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/muse_manifest.xml
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,147,43)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,147,77)
    Command: STOR muse_manifest.xml
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/muse_manifest.xml
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,152,8)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,152,60)
    Command: STOR muse_manifest.xml
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/index.html
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,153,212)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,153,253)
    Command: STOR index.html
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/sitemap.xml
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,156,194)
    Command: STOR sitemap.xml
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/index.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts/css
    Response: 550 Failed to change directory.
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Command: MKD css
    Response: 257 "/htdocs/indesign/digitalpublishing/twixl/twixlfacts/css" created
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts/css
    Response: 250 Directory successfully changed.
    Command: PWD
    Response: 257 "/htdocs/indesign/digitalpublishing/twixl/twixlfacts/css"
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,158,202)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,158,252)
    Command: STOR index.css
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/sitemap.xml
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,161,149)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,161,186)
    Command: STOR sitemap.xml
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/css/index.css
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts/css
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,163,215)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,164,8)
    Command: STOR index.css
    Response: 150 Ok to send data.
    Error:        Connection timed out
    Error:        File transfer failed
    Status:      Resolving address of XXXXXXX.netsolhost.com
    Status:      Connecting to XXX.XXX.XXX.XXX:21...
    Status:      Connection established, waiting for welcome message...
    Response: 220 (vsFTPd 2.3.4)
    Command: USER ftpXXXXXXX
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 230 Login successful.
    Command: OPTS UTF8 ON
    Response: 200 Always in UTF8 mode.
    Status:      Connected
    Status:      Starting upload of /Users/blackmountainprod01/Documents/Google Drive/eCampus.pro/cours/Twixl Publisher/Twixl Facts!/export/sitemap.xml
    Command: CWD /htdocs/indesign/digitalpublishing/twixl/twixlfacts
    Response: 250 Directory successfully changed.
    Status:      Retrieving directory listing...
    Command: TYPE I
    Response: 200 Switching to Binary mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,166,69)
    Command: LIST
    Response: 150 Here comes the directory listing.
    Response: 226 Directory send OK.
    Command: TYPE A
    Response: 200 Switching to ASCII mode.
    Command: PASV
    Response: 227 Entering Passive Mode (206,188,192,135,166,96)
    Command: STOR sitemap.xml

  • How to save uploaded image file to Apache Web Server from Tomcat

    Hi guys,
    Perhaps this is not an appropriate topic to ask under this forum but I really don't know where should I post my question. Hope you understand.
    Ok, I need to know if my web application is running in Tomcat5 and user uploading some image file where I need to save these image files to the other server, which is running Apache Web Server. Should I ftp to there or other better method ?
    Anyone got a better idea on doing this kind of process pls advice. Many Thanks !
    regards,
    Mark

    if your Apache server is running in the same computer and if your servlet have write access to the folder in apache under which you want to save the file you can just write the file there but you will have to address concurrency issues.
    Otherwise you will have to do ftp but since apache does not have abuilt in frp server you will need a seperate FTP server for this

  • Read xml file in another web server

    my question is how to read xml file that in another web server???
    my existing code look like that, where the xml file is situated in C drive.
    <%@ page contentType="text/html"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
              javax.xml.parsers.DocumentBuilder,
              org.w3c.dom.*"
    %>
    <%
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("c:/xml/message.xml");
    NodeList nl = doc.getElementsByTagName("message");
    %>
    <html>
    <body>
    <%= nl.item(0).getFirstChild().getNodeValue() %>
    </body>
    </html>

    are you looking for this?
    Document doc = db.parse("http://myotherwebserver/myFile.xml");

  • Mini Web Server Question

    I'm guessing there might be a person or two who can help me with a solution for a new mini that I'm using as a web server. Everything is set up and working perfectly. Apache is running well, and I've established my Virtual Hosts and enabled PHP and MySQL. What I haven't been able to figure out, however, is how to go about limiting access to particular directories on my server.
    Here is what I would like to accomplish.
    I've got a couple of sights that have the root directory of /www/sitename/publichtml/.
    In those public_html directories are resource directories with names like "images" "downloads" etc.
    From my websites, I pull resources from those directories in order to serve images, resources, etc.
    What I would LIKE to do is still allow those directories to serve the resources to the sites, but prohibit direct access to those directories from direct web access. In other words, I want my images to pull from those directories, but I don't want someone to be able to directly navigate to the directory www.sitename/images/imagename.jpg.
    I would like some message to show up along the lines of "You do not have permission to access this directory".
    I attempted to do this with file permissions, but it either allows total access to the directory or won't allow the web pages to pull the resources.
    Does anyone know of any other solution that will help me accomplish my goal?
    Thanks!
    Chris

    You are going to be more likely to get a good answer to this question in the Mac OS X Server forums. If you are using Leopard Server, go [here|http://discussions.apple.com/forum.jspa?forumID=1237].
    If you are using Mac OS X Web Sharing you should post [here|http://discussions.apple.com/forum.jspa?forumID=1225].
    Best of luck.

  • Issue with permissions to upload files into Apache web server to OS 10.8.2

    Hello everyone;
    I setted up Apache web server and mysql to OS 10.8.2 Mountain Lion. It's working fine except for the permissions. I can't upload files into the web site directory. Doesn't recognize, e.g., the PHP function "move_uploaded".
    One problem for my is that I can't modify the permissions by "Terminal" app since it telling me that the "Process completed" and I can't write any script.
    Any suggestion will be welcome.
    Thanks in advance.

    My only question now would be how to speed up Safari's 6.0.1 performance in 10.8.2 or do I just accept that it's a little slower than it was, which is fine. Are other folks having this issue?
    I was primarily passing along info about my particular download speed and for the Web Confidential 3.8 people: make a backup of your passwords b4 installing 10.8.2 or be prepared to upgrade.

  • Writing a string to a file on a web Server

    Hi all,
    i need to write a string of length say 200 chars in a file located on my local apache web server.
    I have an applet that registers username and password +some other information in a string.
    So i need to write this string to a new file every time a new user logs in with a new file name.
    I have this perl script but i dont know how to modify it
    #c:\perl\bin\perl.exe
    # wdwrite
    # this is the CGI that will take the # applet info and write it to a file
    open(OUT, ">> C:/Program Files/Apache Group/Apache2/giorgi/JCachesim/logs/log.txt");
    print "content-type: text/plain\n\n";
    while (<>) {
    print OUT $_;
    print $_;
    close (OUT);
    exit 0;
    And also what do i need to do to call this script (actually not this,the modified one) from my applet?
    I have some snippets of java code but i dont think they work for my case.
    Can you help me?
    Thank you very much,
    Chris

    If it's a perl script, then you can execute it as a CGI or apparently using mod_perl, which I've never worked with. In either case, it's not really a java question; it's a Perl or Apache admin question and you'd probably get better responses on forums for those.
    You can invoke it by opening an HttpURLConnection to it, at whatever path the script lives on at the server.

Maybe you are looking for

  • ITunes for Win XP always gets an error report box when i try to open it

    Recently my iTunes has stgopped opening. Everytime I try to run it I get a send error report box ("iTunes has encountered a problem and needs to close."). When trying to run quicktime, i get a buffer overrun error. I've tried everything. I've uninsta

  • How to get rid of the iTunes V5 and revert to V4.9

    A mass of postings has been prompted by the launch of the appalling iTunes Version 5. This has clearly not been beta tested (or the testers need sacking), and must have caused immense damage to Apple’s reputation. How they can sit there like a rabbit

  • Looking for a specific applications for iphone

    I heard there's an application that you can use as a remote control for your home audio. It's supposed to let you select music from your itunes to play on home speakers. Does anyone know what it's called.

  • Authentication error as sysdba privilege

    Friends , In my Redhat Ent Linux 5 server I have to face the below problem while I am connectiong to the database as sysdba privileges : [oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 27 13:41:07 2009 C

  • AlV Grid Standard Buttons

    Hi ,             How to remove the standard buttons on the WD4A alv grid like View (Std. View) , Print Version , Export , Filter , Settings. Thanks, Kumar